aboutsummaryrefslogtreecommitdiff
path: root/crypto/dh
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-05-16 16:18:13 +0200
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-05-18 08:53:48 +0200
commit6db7fadf0975c75bfba01dd939063b4bdcb1a0fe (patch)
tree0406141399b090370828fabeeec3359a9b209237 /crypto/dh
parentb336ce57f2d5cca803a920d2a9e622b588cead3c (diff)
downloadopenssl-6db7fadf0975c75bfba01dd939063b4bdcb1a0fe.zip
openssl-6db7fadf0975c75bfba01dd939063b4bdcb1a0fe.tar.gz
openssl-6db7fadf0975c75bfba01dd939063b4bdcb1a0fe.tar.bz2
DH: add simple getters for commonly used DH struct members
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6273)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_lib.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index a33f324..a61aa4d 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -243,6 +243,31 @@ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
return 1;
}
+const BIGNUM *DH_get0_p(const DH *dh)
+{
+ return dh->p;
+}
+
+const BIGNUM *DH_get0_q(const DH *dh)
+{
+ return dh->q;
+}
+
+const BIGNUM *DH_get0_g(const DH *dh)
+{
+ return dh->g;
+}
+
+const BIGNUM *DH_get0_priv_key(const DH *dh)
+{
+ return dh->priv_key;
+}
+
+const BIGNUM *DH_get0_pub_key(const DH *dh)
+{
+ return dh->pub_key;
+}
+
void DH_clear_flags(DH *dh, int flags)
{
dh->flags &= ~flags;