summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dh')
-rw-r--r--src/lib/libcrypto/dh/dh_ameth.c60
-rw-r--r--src/lib/libcrypto/dh/dh_key.c15
-rw-r--r--src/lib/libcrypto/dh/dh_pmeth.c42
3 files changed, 46 insertions, 71 deletions
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c
index d39f4b373d..a22614ae0a 100644
--- a/src/lib/libcrypto/dh/dh_ameth.c
+++ b/src/lib/libcrypto/dh/dh_ameth.c
@@ -466,36 +466,32 @@ int DHparams_print(BIO *bp, const DH *x)
466 return do_dh_print(bp, x, 4, NULL, 0); 466 return do_dh_print(bp, x, 4, NULL, 0);
467 } 467 }
468 468
469const EVP_PKEY_ASN1_METHOD dh_asn1_meth = 469const EVP_PKEY_ASN1_METHOD dh_asn1_meth = {
470 { 470 .pkey_id = EVP_PKEY_DH,
471 EVP_PKEY_DH, 471 .pkey_base_id = EVP_PKEY_DH,
472 EVP_PKEY_DH, 472
473 0, 473 .pem_str = "DH",
474 474 .info = "OpenSSL PKCS#3 DH method",
475 "DH", 475
476 "OpenSSL PKCS#3 DH method", 476 .pub_decode = dh_pub_decode,
477 477 .pub_encode = dh_pub_encode,
478 dh_pub_decode, 478 .pub_cmp = dh_pub_cmp,
479 dh_pub_encode, 479 .pub_print = dh_public_print,
480 dh_pub_cmp, 480
481 dh_public_print, 481 .priv_decode = dh_priv_decode,
482 482 .priv_encode = dh_priv_encode,
483 dh_priv_decode, 483 .priv_print = dh_private_print,
484 dh_priv_encode, 484
485 dh_private_print, 485 .pkey_size = int_dh_size,
486 486 .pkey_bits = dh_bits,
487 int_dh_size, 487
488 dh_bits, 488 .param_decode = dh_param_decode,
489 489 .param_encode = dh_param_encode,
490 dh_param_decode, 490 .param_missing = dh_missing_parameters,
491 dh_param_encode, 491 .param_copy = dh_copy_parameters,
492 dh_missing_parameters, 492 .param_cmp = dh_cmp_parameters,
493 dh_copy_parameters, 493 .param_print = dh_param_print,
494 dh_cmp_parameters, 494
495 dh_param_print, 495 .pkey_free = int_dh_free,
496 0, 496};
497
498 int_dh_free,
499 0
500 };
501 497
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c
index 9596270f7d..91352a9fbf 100644
--- a/src/lib/libcrypto/dh/dh_key.c
+++ b/src/lib/libcrypto/dh/dh_key.c
@@ -82,15 +82,12 @@ int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
82 } 82 }
83 83
84static DH_METHOD dh_ossl = { 84static DH_METHOD dh_ossl = {
85"OpenSSL DH Method", 85 .name = "OpenSSL DH Method",
86generate_key, 86 .generate_key = generate_key,
87compute_key, 87 .compute_key = compute_key,
88dh_bn_mod_exp, 88 .bn_mod_exp = dh_bn_mod_exp,
89dh_init, 89 .init = dh_init,
90dh_finish, 90 .finish = dh_finish,
910,
92NULL,
93NULL
94}; 91};
95 92
96const DH_METHOD *DH_OpenSSL(void) 93const DH_METHOD *DH_OpenSSL(void)
diff --git a/src/lib/libcrypto/dh/dh_pmeth.c b/src/lib/libcrypto/dh/dh_pmeth.c
index ec4553c0a8..c359bb4d2b 100644
--- a/src/lib/libcrypto/dh/dh_pmeth.c
+++ b/src/lib/libcrypto/dh/dh_pmeth.c
@@ -217,38 +217,20 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
217 return 1; 217 return 1;
218 } 218 }
219 219
220const EVP_PKEY_METHOD dh_pkey_meth = 220const EVP_PKEY_METHOD dh_pkey_meth = {
221 { 221 .pkey_id = EVP_PKEY_DH,
222 EVP_PKEY_DH, 222 .flags = EVP_PKEY_FLAG_AUTOARGLEN,
223 EVP_PKEY_FLAG_AUTOARGLEN,
224 pkey_dh_init,
225 pkey_dh_copy,
226 pkey_dh_cleanup,
227
228 0,
229 pkey_dh_paramgen,
230
231 0,
232 pkey_dh_keygen,
233
234 0,
235 0,
236
237 0,
238 0,
239
240 0,0,
241
242 0,0,0,0,
243 223
244 0,0, 224 .init = pkey_dh_init,
225 .copy = pkey_dh_copy,
226 .cleanup = pkey_dh_cleanup,
245 227
246 0,0, 228 .paramgen = pkey_dh_paramgen,
247 229
248 0, 230 .keygen = pkey_dh_keygen,
249 pkey_dh_derive,
250 231
251 pkey_dh_ctrl, 232 .derive = pkey_dh_derive,
252 pkey_dh_ctrl_str
253 233
254 }; 234 .ctrl = pkey_dh_ctrl,
235 .ctrl_str = pkey_dh_ctrl_str
236};