diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_prn.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_prn.c b/src/lib/libcrypto/rsa/rsa_prn.c index c46b08c00d..46e09dc117 100644 --- a/src/lib/libcrypto/rsa/rsa_prn.c +++ b/src/lib/libcrypto/rsa/rsa_prn.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_prn.c,v 1.7 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: rsa_prn.c,v 1.8 2022/11/08 12:59:36 tobhe Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -82,12 +82,16 @@ int | |||
| 82 | RSA_print(BIO *bp, const RSA *x, int off) | 82 | RSA_print(BIO *bp, const RSA *x, int off) |
| 83 | { | 83 | { |
| 84 | EVP_PKEY *pk; | 84 | EVP_PKEY *pk; |
| 85 | int ret; | 85 | int ret = 0; |
| 86 | |||
| 87 | if ((pk = EVP_PKEY_new()) == NULL) | ||
| 88 | goto out; | ||
| 89 | |||
| 90 | if (!EVP_PKEY_set1_RSA(pk, (RSA *)x)) | ||
| 91 | goto out; | ||
| 86 | 92 | ||
| 87 | pk = EVP_PKEY_new(); | ||
| 88 | if (!pk || !EVP_PKEY_set1_RSA(pk, (RSA *)x)) | ||
| 89 | return 0; | ||
| 90 | ret = EVP_PKEY_print_private(bp, pk, off, NULL); | 93 | ret = EVP_PKEY_print_private(bp, pk, off, NULL); |
| 94 | out: | ||
| 91 | EVP_PKEY_free(pk); | 95 | EVP_PKEY_free(pk); |
| 92 | return ret; | 96 | return ret; |
| 93 | } | 97 | } |
