diff options
| author | tb <> | 2018-02-18 12:55:32 +0000 |
|---|---|---|
| committer | tb <> | 2018-02-18 12:55:32 +0000 |
| commit | 219ea795adff53836ef84e874a6065fdba693551 (patch) | |
| tree | 60fbf0cd380d668ed3d2b973bfbc5e7f261824c4 /src/lib/libcrypto/rsa/rsa_lib.c | |
| parent | 1043e31231449505e6e7d161fca44b9627b02643 (diff) | |
| download | openbsd-219ea795adff53836ef84e874a6065fdba693551.tar.gz openbsd-219ea795adff53836ef84e874a6065fdba693551.tar.bz2 openbsd-219ea795adff53836ef84e874a6065fdba693551.zip | |
Use usual order of RSA_{g,s}et0_key().
ok jsing
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_lib.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_lib.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index c31aa935b7..379f4cbe34 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_lib.c,v 1.33 2018/02/18 12:53:46 tb Exp $ */ | 1 | /* $OpenBSD: rsa_lib.c,v 1.34 2018/02/18 12:55:32 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 | * |
| @@ -257,6 +257,17 @@ RSA_get_ex_data(const RSA *r, int idx) | |||
| 257 | return CRYPTO_get_ex_data(&r->ex_data, idx); | 257 | return CRYPTO_get_ex_data(&r->ex_data, idx); |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | void | ||
| 261 | RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) | ||
| 262 | { | ||
| 263 | if (n != NULL) | ||
| 264 | *n = r->n; | ||
| 265 | if (e != NULL) | ||
| 266 | *e = r->e; | ||
| 267 | if (d != NULL) | ||
| 268 | *d = r->d; | ||
| 269 | } | ||
| 270 | |||
| 260 | int | 271 | int |
| 261 | RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) | 272 | RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) |
| 262 | { | 273 | { |
| @@ -279,16 +290,6 @@ RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) | |||
| 279 | return 1; | 290 | return 1; |
| 280 | } | 291 | } |
| 281 | 292 | ||
| 282 | void | ||
| 283 | RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) | ||
| 284 | { | ||
| 285 | if (n != NULL) | ||
| 286 | *n = r->n; | ||
| 287 | if (e != NULL) | ||
| 288 | *e = r->e; | ||
| 289 | if (d != NULL) | ||
| 290 | *d = r->d; | ||
| 291 | } | ||
| 292 | 293 | ||
| 293 | void | 294 | void |
| 294 | RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) | 295 | RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) |
