diff options
Diffstat (limited to 'src/lib/libcrypto/dh/dh_lib.c')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index d45dc17168..5a54ca88da 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dh_lib.c,v 1.22 2017/01/29 17:49:22 beck Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.23 2018/02/17 13:47:36 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 | * |
| @@ -239,3 +239,23 @@ DH_size(const DH *dh) | |||
| 239 | { | 239 | { |
| 240 | return BN_num_bytes(dh->p); | 240 | return BN_num_bytes(dh->p); |
| 241 | } | 241 | } |
| 242 | |||
| 243 | void | ||
| 244 | DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | ||
| 245 | { | ||
| 246 | if (p != NULL) | ||
| 247 | *p = dh->p; | ||
| 248 | if (q != NULL) | ||
| 249 | *q = dh->q; | ||
| 250 | if (g != NULL) | ||
| 251 | *g = dh->g; | ||
| 252 | } | ||
| 253 | |||
| 254 | void | ||
| 255 | DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) | ||
| 256 | { | ||
| 257 | if (pub_key != NULL) | ||
| 258 | *pub_key = dh->pub_key; | ||
| 259 | if (priv_key != NULL) | ||
| 260 | *priv_key = dh->priv_key; | ||
| 261 | } | ||
