| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Instantiate a public key crypto key from an X.509 Certificate |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. |
|---|
| 4 | 5 | * Written by David Howells (dhowells@redhat.com) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public Licence |
|---|
| 8 | | - * as published by the Free Software Foundation; either version |
|---|
| 9 | | - * 2 of the Licence, or (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #define pr_fmt(fmt) "X.509: "fmt |
|---|
| .. | .. |
|---|
| 33 | 29 | int ret; |
|---|
| 34 | 30 | |
|---|
| 35 | 31 | pr_devel("==>%s()\n", __func__); |
|---|
| 32 | + |
|---|
| 33 | + sig->data = cert->tbs; |
|---|
| 34 | + sig->data_size = cert->tbs_size; |
|---|
| 36 | 35 | |
|---|
| 37 | 36 | if (!cert->pub->pkey_algo) |
|---|
| 38 | 37 | cert->unsupported_key = true; |
|---|
| .. | .. |
|---|
| 77 | 76 | goto error; |
|---|
| 78 | 77 | |
|---|
| 79 | 78 | desc->tfm = tfm; |
|---|
| 80 | | - desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; |
|---|
| 81 | 79 | |
|---|
| 82 | 80 | ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); |
|---|
| 83 | 81 | if (ret < 0) |
|---|