diff options
| author | tb <> | 2023-07-03 09:37:30 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-03 09:37:30 +0000 |
| commit | e115d27d8bc7b4264fc35e8119091d7f068285cb (patch) | |
| tree | a6753b54a4f7e3e3c8959324966f6b3472948d7d /src/lib/libc | |
| parent | 533df13b412695c2d514dce774e30903cf34e280 (diff) | |
| download | openbsd-e115d27d8bc7b4264fc35e8119091d7f068285cb.tar.gz openbsd-e115d27d8bc7b4264fc35e8119091d7f068285cb.tar.bz2 openbsd-e115d27d8bc7b4264fc35e8119091d7f068285cb.zip | |
Explicit parameter printing can also use get0_order()
ok beck jsing
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ec/eck_prn.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c index 25965ed962..4b53ab3f66 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.25 2023/07/02 14:54:37 tb Exp $ */ | 1 | /* $OpenBSD: eck_prn.c,v 1.26 2023/07/03 09:37:30 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -69,6 +69,8 @@ | |||
| 69 | #include <openssl/err.h> | 69 | #include <openssl/err.h> |
| 70 | #include <openssl/evp.h> | 70 | #include <openssl/evp.h> |
| 71 | 71 | ||
| 72 | #include "ec_local.h" | ||
| 73 | |||
| 72 | int | 74 | int |
| 73 | ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) | 75 | ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) |
| 74 | { | 76 | { |
| @@ -200,7 +202,8 @@ static int | |||
| 200 | ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off) | 202 | ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off) |
| 201 | { | 203 | { |
| 202 | BN_CTX *ctx = NULL; | 204 | BN_CTX *ctx = NULL; |
| 203 | BIGNUM *p, *a, *b, *order, *cofactor; | 205 | const BIGNUM *order; |
| 206 | BIGNUM *p, *a, *b, *cofactor; | ||
| 204 | BIGNUM *gen = NULL; | 207 | BIGNUM *gen = NULL; |
| 205 | const EC_POINT *generator; | 208 | const EC_POINT *generator; |
| 206 | const char *conversion_form; | 209 | const char *conversion_form; |
| @@ -226,8 +229,6 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off) | |||
| 226 | goto err; | 229 | goto err; |
| 227 | if ((b = BN_CTX_get(ctx)) == NULL) | 230 | if ((b = BN_CTX_get(ctx)) == NULL) |
| 228 | goto err; | 231 | goto err; |
| 229 | if ((order = BN_CTX_get(ctx)) == NULL) | ||
| 230 | goto err; | ||
| 231 | if ((cofactor = BN_CTX_get(ctx)) == NULL) | 232 | if ((cofactor = BN_CTX_get(ctx)) == NULL) |
| 232 | goto err; | 233 | goto err; |
| 233 | if ((gen = BN_CTX_get(ctx)) == NULL) | 234 | if ((gen = BN_CTX_get(ctx)) == NULL) |
| @@ -237,7 +238,7 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off) | |||
| 237 | ECerror(ERR_R_EC_LIB); | 238 | ECerror(ERR_R_EC_LIB); |
| 238 | goto err; | 239 | goto err; |
| 239 | } | 240 | } |
| 240 | if (!EC_GROUP_get_order(group, order, NULL)) { | 241 | if ((order = EC_GROUP_get0_order(group)) == NULL) { |
| 241 | ECerror(ERR_R_EC_LIB); | 242 | ECerror(ERR_R_EC_LIB); |
| 242 | goto err; | 243 | goto err; |
| 243 | } | 244 | } |
