summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/dsa
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-02-17 13:47:35 +0000
committertb <tb@openbsd.org>2018-02-17 13:47:35 +0000
commitf08abba079dae83ad95b35691473b9253691c43b (patch)
tree7675b221c057cf2bcd2431d48a775c6e985b0d5d /lib/libcrypto/dsa
parent- Add descriptions for the new functions ifcreate() and vifscreate() (diff)
downloadwireguard-openbsd-f08abba079dae83ad95b35691473b9253691c43b.tar.xz
wireguard-openbsd-f08abba079dae83ad95b35691473b9253691c43b.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 'lib/libcrypto/dsa')
-rw-r--r--lib/libcrypto/dsa/dsa.h6
-rw-r--r--lib/libcrypto/dsa/dsa_lib.c22
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/libcrypto/dsa/dsa.h b/lib/libcrypto/dsa/dsa.h
index 6ddd4c35d5c..f990ad52f04 100644
--- a/lib/libcrypto/dsa/dsa.h
+++ b/lib/libcrypto/dsa/dsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa.h,v 1.22 2016/11/04 18:35:30 jsing Exp $ */
+/* $OpenBSD: dsa.h,v 1.23 2018/02/17 13:47:36 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -257,6 +257,10 @@ int DSA_print_fp(FILE *bp, const DSA *x, int off);
DH *DSA_dup_DH(const DSA *r);
#endif
+void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q,
+ const BIGNUM **g);
+void DSA_get0_key(const DH *d, const BIGNUM **pub_key, const BIGNUM **priv_key);
+
#define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \
EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)
diff --git a/lib/libcrypto/dsa/dsa_lib.c b/lib/libcrypto/dsa/dsa_lib.c
index 58af74889cc..ae9155c9f8c 100644
--- a/lib/libcrypto/dsa/dsa_lib.c
+++ b/lib/libcrypto/dsa/dsa_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_lib.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: dsa_lib.c,v 1.24 2018/02/17 13:47:36 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -303,3 +303,23 @@ err:
return NULL;
}
#endif
+
+void
+DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
+{
+ if (p != NULL)
+ *p = d->p;
+ if (q != NULL)
+ *q = d->q;
+ if (g != NULL)
+ *g = d->g;
+}
+
+void
+DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key)
+{
+ if (pub_key != NULL)
+ *pub_key = d->pub_key;
+ if (priv_key != NULL)
+ *priv_key = d->priv_key;
+}