diff options
author | tb <> | 2022-01-14 09:25:42 +0000 |
---|---|---|
committer | tb <> | 2022-01-14 09:25:42 +0000 |
commit | 39261d6be5ea733b0d1102656d340fa546b83d9f (patch) | |
tree | 6b177503f5794ffa7d7d5040918848fa8b9f3b2b | |
parent | d60e3f077ef5ed2580284526ddd10c1e4995e52d (diff) | |
download | openbsd-39261d6be5ea733b0d1102656d340fa546b83d9f.tar.gz openbsd-39261d6be5ea733b0d1102656d340fa546b83d9f.tar.bz2 openbsd-39261d6be5ea733b0d1102656d340fa546b83d9f.zip |
openssl(1) genrsa: simplify access to rsa->e
ok inoguchi jsing
-rw-r--r-- | src/usr.bin/openssl/genrsa.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/usr.bin/openssl/genrsa.c b/src/usr.bin/openssl/genrsa.c index 024fa88d26..a199ba2e45 100644 --- a/src/usr.bin/openssl/genrsa.c +++ b/src/usr.bin/openssl/genrsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: genrsa.c,v 1.18 2021/11/20 18:10:48 tb Exp $ */ | 1 | /* $OpenBSD: genrsa.c,v 1.19 2022/01/14 09:25:42 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -278,7 +278,6 @@ genrsa_main(int argc, char **argv) | |||
278 | BIO *out = NULL; | 278 | BIO *out = NULL; |
279 | BIGNUM *bn = NULL; | 279 | BIGNUM *bn = NULL; |
280 | RSA *rsa = NULL; | 280 | RSA *rsa = NULL; |
281 | const BIGNUM *rsa_e = NULL; | ||
282 | char *rsa_e_hex = NULL, *rsa_e_dec = NULL; | 281 | char *rsa_e_hex = NULL, *rsa_e_dec = NULL; |
283 | 282 | ||
284 | if (single_execution) { | 283 | if (single_execution) { |
@@ -342,10 +341,9 @@ genrsa_main(int argc, char **argv) | |||
342 | !RSA_generate_key_ex(rsa, num, bn, cb)) | 341 | !RSA_generate_key_ex(rsa, num, bn, cb)) |
343 | goto err; | 342 | goto err; |
344 | 343 | ||
345 | RSA_get0_key(rsa, NULL, &rsa_e, NULL); | 344 | if ((rsa_e_hex = BN_bn2hex(RSA_get0_e(rsa))) == NULL) |
346 | if ((rsa_e_hex = BN_bn2hex(rsa_e)) == NULL) | ||
347 | goto err; | 345 | goto err; |
348 | if ((rsa_e_dec = BN_bn2dec(rsa_e)) == NULL) | 346 | if ((rsa_e_dec = BN_bn2dec(RSA_get0_e(rsa))) == NULL) |
349 | goto err; | 347 | goto err; |
350 | 348 | ||
351 | BIO_printf(bio_err, "e is %s (0x%s)\n", rsa_e_hex, rsa_e_dec); | 349 | BIO_printf(bio_err, "e is %s (0x%s)\n", rsa_e_hex, rsa_e_dec); |