summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-11-14 10:16:02 +0000
committertb <>2024-11-14 10:16:02 +0000
commitc59a06db65032250ef7e451eab8a86ba86a80b48 (patch)
tree5144100762f14e67380470c29072c0a41855ba40 /src/lib
parent9919e862a068e33660e015b9e612aa23baa7bdb0 (diff)
downloadopenbsd-c59a06db65032250ef7e451eab8a86ba86a80b48.tar.gz
openbsd-c59a06db65032250ef7e451eab8a86ba86a80b48.tar.bz2
openbsd-c59a06db65032250ef7e451eab8a86ba86a80b48.zip
eck_prn: sprinkle some empty lines and drop some parens for consistency
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c30
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}
91LCRYPTO_ALIAS(EC_KEY_print); 93LCRYPTO_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}
108LCRYPTO_ALIAS(EC_KEY_print_fp); 114LCRYPTO_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}
127LCRYPTO_ALIAS(ECParameters_print); 135LCRYPTO_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}
144LCRYPTO_ALIAS(ECParameters_print_fp); 156LCRYPTO_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}
339LCRYPTO_ALIAS(ECPKParameters_print_fp); 355LCRYPTO_ALIAS(ECPKParameters_print_fp);