diff options
| author | tb <> | 2018-02-17 13:47:36 +0000 |
|---|---|---|
| committer | tb <> | 2018-02-17 13:47:36 +0000 |
| commit | fbfe5db25186968deb518dba39952191d6027694 (patch) | |
| tree | f0cc2d3dd2a3842c40f792227fe86c133a668af2 /src/lib/libcrypto/dsa | |
| parent | b732099185abf3eb7cfc13188bc9d63577329586 (diff) | |
| download | openbsd-fbfe5db25186968deb518dba39952191d6027694.tar.gz openbsd-fbfe5db25186968deb518dba39952191d6027694.tar.bz2 openbsd-fbfe5db25186968deb518dba39952191d6027694.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/dsa')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa.h | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_lib.c | 22 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h index 6ddd4c35d5..f990ad52f0 100644 --- a/src/lib/libcrypto/dsa/dsa.h +++ b/src/lib/libcrypto/dsa/dsa.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dsa.h,v 1.22 2016/11/04 18:35:30 jsing Exp $ */ | 1 | /* $OpenBSD: dsa.h,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 | * |
| @@ -257,6 +257,10 @@ int DSA_print_fp(FILE *bp, const DSA *x, int off); | |||
| 257 | DH *DSA_dup_DH(const DSA *r); | 257 | DH *DSA_dup_DH(const DSA *r); |
| 258 | #endif | 258 | #endif |
| 259 | 259 | ||
| 260 | void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, | ||
| 261 | const BIGNUM **g); | ||
| 262 | void DSA_get0_key(const DH *d, const BIGNUM **pub_key, const BIGNUM **priv_key); | ||
| 263 | |||
| 260 | #define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ | 264 | #define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ |
| 261 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ | 265 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ |
| 262 | EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) | 266 | EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) |
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index 58af74889c..ae9155c9f8 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.23 2017/01/29 17:49:22 beck Exp $ */ | 1 | /* $OpenBSD: dsa_lib.c,v 1.24 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 | * |
| @@ -303,3 +303,23 @@ err: | |||
| 303 | return NULL; | 303 | return NULL; |
| 304 | } | 304 | } |
| 305 | #endif | 305 | #endif |
| 306 | |||
| 307 | void | ||
| 308 | DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | ||
| 309 | { | ||
| 310 | if (p != NULL) | ||
| 311 | *p = d->p; | ||
| 312 | if (q != NULL) | ||
| 313 | *q = d->q; | ||
| 314 | if (g != NULL) | ||
| 315 | *g = d->g; | ||
| 316 | } | ||
| 317 | |||
| 318 | void | ||
| 319 | DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) | ||
| 320 | { | ||
| 321 | if (pub_key != NULL) | ||
| 322 | *pub_key = d->pub_key; | ||
| 323 | if (priv_key != NULL) | ||
| 324 | *priv_key = d->priv_key; | ||
| 325 | } | ||
