diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/eck_prn.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c index e30b8bab0a..7fa828293e 100644 --- a/src/lib/libcrypto/ec/eck_prn.c +++ b/src/lib/libcrypto/ec/eck_prn.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: eck_prn.c,v 1.32 2024/11/14 10:11:43 tb Exp $ */ | 1 | /* $OpenBSD: eck_prn.c,v 1.33 2024/11/14 10:16:02 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -84,8 +84,10 @@ EC_KEY_print(BIO *bp, const EC_KEY *x, int off) | |||
| 84 | goto err; | 84 | goto err; |
| 85 | 85 | ||
| 86 | ret = EVP_PKEY_print_private(bp, pk, off, NULL); | 86 | ret = EVP_PKEY_print_private(bp, pk, off, NULL); |
| 87 | |||
| 87 | err: | 88 | err: |
| 88 | EVP_PKEY_free(pk); | 89 | EVP_PKEY_free(pk); |
| 90 | |||
| 89 | return ret; | 91 | return ret; |
| 90 | } | 92 | } |
| 91 | LCRYPTO_ALIAS(EC_KEY_print); | 93 | LCRYPTO_ALIAS(EC_KEY_print); |
| @@ -98,12 +100,16 @@ EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off) | |||
| 98 | 100 | ||
| 99 | if ((b = BIO_new(BIO_s_file())) == NULL) { | 101 | if ((b = BIO_new(BIO_s_file())) == NULL) { |
| 100 | ECerror(ERR_R_BIO_LIB); | 102 | ECerror(ERR_R_BIO_LIB); |
| 101 | return (0); | 103 | return 0; |
| 102 | } | 104 | } |
| 105 | |||
| 103 | BIO_set_fp(b, fp, BIO_NOCLOSE); | 106 | BIO_set_fp(b, fp, BIO_NOCLOSE); |
| 107 | |||
| 104 | ret = EC_KEY_print(b, x, off); | 108 | ret = EC_KEY_print(b, x, off); |
| 109 | |||
| 105 | BIO_free(b); | 110 | BIO_free(b); |
| 106 | return (ret); | 111 | |
| 112 | return ret; | ||
| 107 | } | 113 | } |
| 108 | LCRYPTO_ALIAS(EC_KEY_print_fp); | 114 | LCRYPTO_ALIAS(EC_KEY_print_fp); |
| 109 | 115 | ||
| @@ -120,8 +126,10 @@ ECParameters_print(BIO *bp, const EC_KEY *x) | |||
| 120 | goto err; | 126 | goto err; |
| 121 | 127 | ||
| 122 | ret = EVP_PKEY_print_params(bp, pk, 4, NULL); | 128 | ret = EVP_PKEY_print_params(bp, pk, 4, NULL); |
| 129 | |||
| 123 | err: | 130 | err: |
| 124 | EVP_PKEY_free(pk); | 131 | EVP_PKEY_free(pk); |
| 132 | |||
| 125 | return ret; | 133 | return ret; |
| 126 | } | 134 | } |
| 127 | LCRYPTO_ALIAS(ECParameters_print); | 135 | LCRYPTO_ALIAS(ECParameters_print); |
| @@ -134,12 +142,16 @@ ECParameters_print_fp(FILE *fp, const EC_KEY *x) | |||
| 134 | 142 | ||
| 135 | if ((b = BIO_new(BIO_s_file())) == NULL) { | 143 | if ((b = BIO_new(BIO_s_file())) == NULL) { |
| 136 | ECerror(ERR_R_BIO_LIB); | 144 | ECerror(ERR_R_BIO_LIB); |
| 137 | return (0); | 145 | return 0; |
| 138 | } | 146 | } |
| 147 | |||
| 139 | BIO_set_fp(b, fp, BIO_NOCLOSE); | 148 | BIO_set_fp(b, fp, BIO_NOCLOSE); |
| 149 | |||
| 140 | ret = ECParameters_print(b, x); | 150 | ret = ECParameters_print(b, x); |
| 151 | |||
| 141 | BIO_free(b); | 152 | BIO_free(b); |
| 142 | return (ret); | 153 | |
| 154 | return ret; | ||
| 143 | } | 155 | } |
| 144 | LCRYPTO_ALIAS(ECParameters_print_fp); | 156 | LCRYPTO_ALIAS(ECParameters_print_fp); |
| 145 | 157 | ||
| @@ -329,11 +341,15 @@ ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) | |||
| 329 | 341 | ||
| 330 | if ((b = BIO_new(BIO_s_file())) == NULL) { | 342 | if ((b = BIO_new(BIO_s_file())) == NULL) { |
| 331 | ECerror(ERR_R_BUF_LIB); | 343 | ECerror(ERR_R_BUF_LIB); |
| 332 | return (0); | 344 | return 0; |
| 333 | } | 345 | } |
| 346 | |||
| 334 | BIO_set_fp(b, fp, BIO_NOCLOSE); | 347 | BIO_set_fp(b, fp, BIO_NOCLOSE); |
| 348 | |||
| 335 | ret = ECPKParameters_print(b, x, off); | 349 | ret = ECPKParameters_print(b, x, off); |
| 350 | |||
| 336 | BIO_free(b); | 351 | BIO_free(b); |
| 337 | return (ret); | 352 | |
| 353 | return ret; | ||
| 338 | } | 354 | } |
| 339 | LCRYPTO_ALIAS(ECPKParameters_print_fp); | 355 | LCRYPTO_ALIAS(ECPKParameters_print_fp); |
