summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_lib.c
diff options
context:
space:
mode:
authortb <>2018-02-17 13:47:36 +0000
committertb <>2018-02-17 13:47:36 +0000
commite1b05f77869d986a0aee6aa4076f008274e98d27 (patch)
treef0cc2d3dd2a3842c40f792227fe86c133a668af2 /src/lib/libcrypto/dh/dh_lib.c
parent0c7165079d7f7c944f8c516a5bb23a71b674c170 (diff)
downloadopenbsd-e1b05f77869d986a0aee6aa4076f008274e98d27.tar.gz
openbsd-e1b05f77869d986a0aee6aa4076f008274e98d27.tar.bz2
openbsd-e1b05f77869d986a0aee6aa4076f008274e98d27.zip
Provide further parts of the OpenSSL 1.1 API: {DH,DSA}_get0_{key,pqg}(),
EVP_PKEY_get0_{DH,DSA,RSA}(), RSA_{g,s}et0_key(). ok jsing
Diffstat (limited to 'src/lib/libcrypto/dh/dh_lib.c')
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c22
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
243void
244DH_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
254void
255DH_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}