diff options
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_lib.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_lib.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index ae9155c9f8..2dec8567f5 100644 --- a/src/lib/libcrypto/dsa/dsa_lib.c +++ b/src/lib/libcrypto/dsa/dsa_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dsa_lib.c,v 1.24 2018/02/17 13:47:36 tb Exp $ */ | 1 | /* $OpenBSD: dsa_lib.c,v 1.25 2018/02/18 12:50:58 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 | * |
| @@ -315,6 +315,29 @@ DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | |||
| 315 | *g = d->g; | 315 | *g = d->g; |
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | int | ||
| 319 | DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) | ||
| 320 | { | ||
| 321 | if ((d->p == NULL && p == NULL) || (d->q == NULL && q == NULL) || | ||
| 322 | (d->g == NULL && g == NULL)) | ||
| 323 | return 0; | ||
| 324 | |||
| 325 | if (p != NULL) { | ||
| 326 | BN_free(d->p); | ||
| 327 | d->p = p; | ||
| 328 | } | ||
| 329 | if (q != NULL) { | ||
| 330 | BN_free(d->q); | ||
| 331 | d->q = q; | ||
| 332 | } | ||
| 333 | if (g != NULL) { | ||
| 334 | BN_free(d->g); | ||
| 335 | d->g = g; | ||
| 336 | } | ||
| 337 | |||
| 338 | return 1; | ||
| 339 | } | ||
| 340 | |||
| 318 | void | 341 | void |
| 319 | DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) | 342 | DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) |
| 320 | { | 343 | { |
