summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2014-04-27 20:26:49 +0000
committermiod <>2014-04-27 20:26:49 +0000
commit45bb7f0ae87ddf787dd06d515db9afb04a74bf6c (patch)
tree319f4236c4f33e8d28d3d3a51c99e82d996e948f
parentcbbb78bcf8e4dca14564fbea5fdfe0703e2951cc (diff)
downloadopenbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.tar.gz
openbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.tar.bz2
openbsd-45bb7f0ae87ddf787dd06d515db9afb04a74bf6c.zip
Use C99 initializers for the various FOO_METHOD structs. More readable, and
avoid unreadable/unmaintainable constructs like that: const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { EVP_PKEY_CMAC, EVP_PKEY_CMAC, 0, "CMAC", "OpenSSL CMAC method", 0,0,0,0, 0,0,0, cmac_size, 0, 0,0,0,0,0,0,0, cmac_key_free, 0, 0,0 }; ok matthew@ deraadt@
-rw-r--r--src/lib/libcrypto/asn1/bio_asn1.c20
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c7
-rw-r--r--src/lib/libcrypto/bio/bf_buff.c20
-rw-r--r--src/lib/libcrypto/bio/bf_lbuf.c20
-rw-r--r--src/lib/libcrypto/bio/bf_nbio.c20
-rw-r--r--src/lib/libcrypto/bio/bf_null.c20
-rw-r--r--src/lib/libcrypto/bio/bss_acpt.c18
-rw-r--r--src/lib/libcrypto/bio/bss_bio.c18
-rw-r--r--src/lib/libcrypto/bio/bss_conn.c19
-rw-r--r--src/lib/libcrypto/bio/bss_dgram.c36
-rw-r--r--src/lib/libcrypto/bio/bss_fd.c18
-rw-r--r--src/lib/libcrypto/bio/bss_file.c19
-rw-r--r--src/lib/libcrypto/bio/bss_log.c16
-rw-r--r--src/lib/libcrypto/bio/bss_mem.c19
-rw-r--r--src/lib/libcrypto/bio/bss_null.c19
-rw-r--r--src/lib/libcrypto/bio/bss_sock.c18
-rw-r--r--src/lib/libcrypto/cmac/cm_ameth.c27
-rw-r--r--src/lib/libcrypto/cmac/cm_pmeth.c42
-rw-r--r--src/lib/libcrypto/comp/c_rle.c12
-rw-r--r--src/lib/libcrypto/comp/c_zlib.c54
-rw-r--r--src/lib/libcrypto/conf/conf_def.c20
-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
-rw-r--r--src/lib/libcrypto/dsa/dsa_ameth.c110
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c18
-rw-r--r--src/lib/libcrypto/dsa/dsa_pmeth.c42
-rw-r--r--src/lib/libcrypto/dso/dso_dlfcn.c26
-rw-r--r--src/lib/libcrypto/dso/dso_null.c18
-rw-r--r--src/lib/libcrypto/ec/ec2_smpl.c79
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c64
-rw-r--r--src/lib/libcrypto/ec/ec_pmeth.c41
-rw-r--r--src/lib/libcrypto/ec/ecp_mont.c82
-rw-r--r--src/lib/libcrypto/ec/ecp_nist.c79
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp224.c84
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp256.c84
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp521.c84
-rw-r--r--src/lib/libcrypto/ec/ecp_smpl.c79
-rw-r--r--src/lib/libcrypto/ecdh/ech_ossl.c10
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_ossl.c14
-rw-r--r--src/lib/libcrypto/engine/eng_padlock.c9
-rw-r--r--src/lib/libcrypto/engine/eng_rdrand.c14
-rw-r--r--src/lib/libcrypto/engine/eng_rsax.c22
-rw-r--r--src/lib/libcrypto/engine/hw_cryptodev.c34
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c23
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c22
-rw-r--r--src/lib/libcrypto/evp/bio_md.c23
-rw-r--r--src/lib/libcrypto/evp/bio_ok.c22
-rw-r--r--src/lib/libcrypto/hmac/hm_ameth.c30
-rw-r--r--src/lib/libcrypto/hmac/hm_pmeth.c41
-rw-r--r--src/lib/libcrypto/pkcs7/bio_ber.c22
-rw-r--r--src/lib/libcrypto/rsa/rsa_ameth.c60
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c27
-rw-r--r--src/lib/libcrypto/rsa/rsa_null.c25
-rw-r--r--src/lib/libcrypto/rsa/rsa_pmeth.c45
-rw-r--r--src/lib/libcrypto/store/str_mem.c35
-rw-r--r--src/lib/libcrypto/ui/ui_openssl.c12
-rw-r--r--src/lib/libssl/src/crypto/asn1/bio_asn1.c20
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_crl.c7
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_buff.c20
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_lbuf.c20
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_nbio.c20
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_null.c20
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_acpt.c18
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_bio.c18
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_conn.c19
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_dgram.c36
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_fd.c18
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_file.c19
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_log.c16
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_mem.c19
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_null.c19
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_sock.c18
-rw-r--r--src/lib/libssl/src/crypto/cmac/cm_ameth.c27
-rw-r--r--src/lib/libssl/src/crypto/cmac/cm_pmeth.c42
-rw-r--r--src/lib/libssl/src/crypto/comp/c_rle.c12
-rw-r--r--src/lib/libssl/src/crypto/comp/c_zlib.c54
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_def.c20
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_ameth.c60
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_key.c15
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_pmeth.c42
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_ameth.c110
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_ossl.c18
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_pmeth.c42
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_dlfcn.c26
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_null.c18
-rw-r--r--src/lib/libssl/src/crypto/ec/ec2_smpl.c79
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_ameth.c64
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_pmeth.c41
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_mont.c82
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_nist.c79
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_nistp224.c84
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_nistp256.c84
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_nistp521.c84
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_smpl.c79
-rw-r--r--src/lib/libssl/src/crypto/ecdh/ech_ossl.c10
-rw-r--r--src/lib/libssl/src/crypto/ecdsa/ecs_ossl.c14
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_padlock.c9
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_rdrand.c14
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_rsax.c22
-rw-r--r--src/lib/libssl/src/crypto/engine/hw_cryptodev.c34
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_b64.c23
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_enc.c22
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_md.c23
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_ok.c22
-rw-r--r--src/lib/libssl/src/crypto/hmac/hm_ameth.c30
-rw-r--r--src/lib/libssl/src/crypto/hmac/hm_pmeth.c41
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/bio_ber.c22
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_ameth.c60
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_eay.c27
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_null.c25
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_pmeth.c45
-rw-r--r--src/lib/libssl/src/crypto/store/str_mem.c35
-rw-r--r--src/lib/libssl/src/crypto/ui/ui_openssl.c12
114 files changed, 1672 insertions, 2246 deletions
diff --git a/src/lib/libcrypto/asn1/bio_asn1.c b/src/lib/libcrypto/asn1/bio_asn1.c
index 36b82758ed..327355eeda 100644
--- a/src/lib/libcrypto/asn1/bio_asn1.c
+++ b/src/lib/libcrypto/asn1/bio_asn1.c
@@ -124,16 +124,16 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
124 asn1_bio_state_t other_state); 124 asn1_bio_state_t other_state);
125 125
126static BIO_METHOD methods_asn1 = { 126static BIO_METHOD methods_asn1 = {
127 BIO_TYPE_ASN1, 127 .type = BIO_TYPE_ASN1,
128 "asn1", 128 .name = "asn1",
129 asn1_bio_write, 129 .bwrite = asn1_bio_write,
130 asn1_bio_read, 130 .bread = asn1_bio_read,
131 asn1_bio_puts, 131 .bputs = asn1_bio_puts,
132 asn1_bio_gets, 132 .bgets = asn1_bio_gets,
133 asn1_bio_ctrl, 133 .ctrl = asn1_bio_ctrl,
134 asn1_bio_new, 134 .create = asn1_bio_new,
135 asn1_bio_free, 135 .destroy = asn1_bio_free,
136 asn1_bio_callback_ctrl, 136 .callback_ctrl = asn1_bio_callback_ctrl
137}; 137};
138 138
139BIO_METHOD * 139BIO_METHOD *
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 674cca4a1c..097a39c4d1 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -78,11 +78,8 @@ static int def_crl_lookup(X509_CRL *crl, X509_REVOKED **ret,
78 ASN1_INTEGER *serial, X509_NAME *issuer); 78 ASN1_INTEGER *serial, X509_NAME *issuer);
79 79
80static X509_CRL_METHOD int_crl_meth = { 80static X509_CRL_METHOD int_crl_meth = {
81 0, 81 .crl_lookup = def_crl_lookup,
82 0, 82 .crl_verify = def_crl_verify
83 0,
84 def_crl_lookup,
85 def_crl_verify
86}; 83};
87 84
88static const X509_CRL_METHOD *default_crl_method = &int_crl_meth; 85static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c
index 99be1a629e..e96da40a58 100644
--- a/src/lib/libcrypto/bio/bf_buff.c
+++ b/src/lib/libcrypto/bio/bf_buff.c
@@ -72,16 +72,16 @@ static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
72#define DEFAULT_BUFFER_SIZE 4096 72#define DEFAULT_BUFFER_SIZE 4096
73 73
74static BIO_METHOD methods_buffer = { 74static BIO_METHOD methods_buffer = {
75 BIO_TYPE_BUFFER, 75 .type = BIO_TYPE_BUFFER,
76 "buffer", 76 .name = "buffer",
77 buffer_write, 77 .bwrite = buffer_write,
78 buffer_read, 78 .bread = buffer_read,
79 buffer_puts, 79 .bputs = buffer_puts,
80 buffer_gets, 80 .bgets = buffer_gets,
81 buffer_ctrl, 81 .ctrl = buffer_ctrl,
82 buffer_new, 82 .create = buffer_new,
83 buffer_free, 83 .destroy = buffer_free,
84 buffer_callback_ctrl, 84 .callback_ctrl = buffer_callback_ctrl
85}; 85};
86 86
87BIO_METHOD * 87BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c
index f0bd0d709e..54c370d038 100644
--- a/src/lib/libcrypto/bio/bf_lbuf.c
+++ b/src/lib/libcrypto/bio/bf_lbuf.c
@@ -77,16 +77,16 @@ static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
77/* #define DEBUG */ 77/* #define DEBUG */
78 78
79static BIO_METHOD methods_linebuffer = { 79static BIO_METHOD methods_linebuffer = {
80 BIO_TYPE_LINEBUFFER, 80 .type = BIO_TYPE_LINEBUFFER,
81 "linebuffer", 81 .name = "linebuffer",
82 linebuffer_write, 82 .bwrite = linebuffer_write,
83 linebuffer_read, 83 .bread = linebuffer_read,
84 linebuffer_puts, 84 .bputs = linebuffer_puts,
85 linebuffer_gets, 85 .bgets = linebuffer_gets,
86 linebuffer_ctrl, 86 .ctrl = linebuffer_ctrl,
87 linebuffer_new, 87 .create = linebuffer_new,
88 linebuffer_free, 88 .destroy = linebuffer_free,
89 linebuffer_callback_ctrl, 89 .callback_ctrl = linebuffer_callback_ctrl
90}; 90};
91 91
92BIO_METHOD * 92BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c
index 048e6892cc..5a0f6b276a 100644
--- a/src/lib/libcrypto/bio/bf_nbio.c
+++ b/src/lib/libcrypto/bio/bf_nbio.c
@@ -81,16 +81,16 @@ typedef struct nbio_test_st {
81} NBIO_TEST; 81} NBIO_TEST;
82 82
83static BIO_METHOD methods_nbiof = { 83static BIO_METHOD methods_nbiof = {
84 BIO_TYPE_NBIO_TEST, 84 .type = BIO_TYPE_NBIO_TEST,
85 "non-blocking IO test filter", 85 .name = "non-blocking IO test filter",
86 nbiof_write, 86 .bwrite = nbiof_write,
87 nbiof_read, 87 .bread = nbiof_read,
88 nbiof_puts, 88 .bputs = nbiof_puts,
89 nbiof_gets, 89 .bgets = nbiof_gets,
90 nbiof_ctrl, 90 .ctrl = nbiof_ctrl,
91 nbiof_new, 91 .create = nbiof_new,
92 nbiof_free, 92 .destroy = nbiof_free,
93 nbiof_callback_ctrl, 93 .callback_ctrl = nbiof_callback_ctrl
94}; 94};
95 95
96BIO_METHOD * 96BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bf_null.c b/src/lib/libcrypto/bio/bf_null.c
index 3bba2afe98..7554ed9cf5 100644
--- a/src/lib/libcrypto/bio/bf_null.c
+++ b/src/lib/libcrypto/bio/bf_null.c
@@ -74,16 +74,16 @@ static int nullf_free(BIO *data);
74static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); 74static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
75 75
76static BIO_METHOD methods_nullf = { 76static BIO_METHOD methods_nullf = {
77 BIO_TYPE_NULL_FILTER, 77 .type = BIO_TYPE_NULL_FILTER,
78 "NULL filter", 78 .name = "NULL filter",
79 nullf_write, 79 .bwrite = nullf_write,
80 nullf_read, 80 .bread = nullf_read,
81 nullf_puts, 81 .bputs = nullf_puts,
82 nullf_gets, 82 .bgets = nullf_gets,
83 nullf_ctrl, 83 .ctrl = nullf_ctrl,
84 nullf_new, 84 .create = nullf_new,
85 nullf_free, 85 .destroy = nullf_free,
86 nullf_callback_ctrl, 86 .callback_ctrl = nullf_callback_ctrl
87}; 87};
88 88
89BIO_METHOD * 89BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c
index 916af3cb20..943d3d9d96 100644
--- a/src/lib/libcrypto/bio/bss_acpt.c
+++ b/src/lib/libcrypto/bio/bss_acpt.c
@@ -98,16 +98,14 @@ static void BIO_ACCEPT_free(BIO_ACCEPT *a);
98#define ACPT_S_OK 3 98#define ACPT_S_OK 3
99 99
100static BIO_METHOD methods_acceptp = { 100static BIO_METHOD methods_acceptp = {
101 BIO_TYPE_ACCEPT, 101 .type = BIO_TYPE_ACCEPT,
102 "socket accept", 102 .name = "socket accept",
103 acpt_write, 103 .bwrite = acpt_write,
104 acpt_read, 104 .bread = acpt_read,
105 acpt_puts, 105 .bputs = acpt_puts,
106 NULL, /* connect_gets, */ 106 .ctrl = acpt_ctrl,
107 acpt_ctrl, 107 .create = acpt_new,
108 acpt_new, 108 .destroy = acpt_free
109 acpt_free,
110 NULL,
111}; 109};
112 110
113BIO_METHOD * 111BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_bio.c b/src/lib/libcrypto/bio/bss_bio.c
index d31e59872e..1a17cdf275 100644
--- a/src/lib/libcrypto/bio/bss_bio.c
+++ b/src/lib/libcrypto/bio/bss_bio.c
@@ -94,16 +94,14 @@ static int bio_make_pair(BIO *bio1, BIO *bio2);
94static void bio_destroy_pair(BIO *bio); 94static void bio_destroy_pair(BIO *bio);
95 95
96static BIO_METHOD methods_biop = { 96static BIO_METHOD methods_biop = {
97 BIO_TYPE_BIO, 97 .type = BIO_TYPE_BIO,
98 "BIO pair", 98 .name = "BIO pair",
99 bio_write, 99 .bwrite = bio_write,
100 bio_read, 100 .bread = bio_read,
101 bio_puts, 101 .bputs = bio_puts,
102 NULL /* no bio_gets */, 102 .ctrl = bio_ctrl,
103 bio_ctrl, 103 .create = bio_new,
104 bio_new, 104 .destroy = bio_free
105 bio_free,
106 NULL /* no bio_callback_ctrl */
107}; 105};
108 106
109BIO_METHOD * 107BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c
index d7a8619b38..7ed8f1fe31 100644
--- a/src/lib/libcrypto/bio/bss_conn.c
+++ b/src/lib/libcrypto/bio/bss_conn.c
@@ -103,16 +103,15 @@ BIO_CONNECT *BIO_CONNECT_new(void);
103void BIO_CONNECT_free(BIO_CONNECT *a); 103void BIO_CONNECT_free(BIO_CONNECT *a);
104 104
105static BIO_METHOD methods_connectp = { 105static BIO_METHOD methods_connectp = {
106 BIO_TYPE_CONNECT, 106 .type = BIO_TYPE_CONNECT,
107 "socket connect", 107 .name = "socket connect",
108 conn_write, 108 .bwrite = conn_write,
109 conn_read, 109 .bread = conn_read,
110 conn_puts, 110 .bputs = conn_puts,
111 NULL, /* connect_gets, */ 111 .ctrl = conn_ctrl,
112 conn_ctrl, 112 .create = conn_new,
113 conn_new, 113 .destroy = conn_free,
114 conn_free, 114 .callback_ctrl = conn_callback_ctrl
115 conn_callback_ctrl,
116}; 115};
117 116
118static int 117static int
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c
index 8c08eff352..8f7439c51e 100644
--- a/src/lib/libcrypto/bio/bss_dgram.c
+++ b/src/lib/libcrypto/bio/bss_dgram.c
@@ -106,30 +106,26 @@ static int BIO_dgram_should_retry(int s);
106static void get_current_time(struct timeval *t); 106static void get_current_time(struct timeval *t);
107 107
108static BIO_METHOD methods_dgramp = { 108static BIO_METHOD methods_dgramp = {
109 BIO_TYPE_DGRAM, 109 .type = BIO_TYPE_DGRAM,
110 "datagram socket", 110 .name = "datagram socket",
111 dgram_write, 111 .bwrite = dgram_write,
112 dgram_read, 112 .bread = dgram_read,
113 dgram_puts, 113 .bputs = dgram_puts,
114 NULL, /* dgram_gets, */ 114 .ctrl = dgram_ctrl,
115 dgram_ctrl, 115 .create = dgram_new,
116 dgram_new, 116 .destroy = dgram_free
117 dgram_free,
118 NULL,
119}; 117};
120 118
121#ifndef OPENSSL_NO_SCTP 119#ifndef OPENSSL_NO_SCTP
122static BIO_METHOD methods_dgramp_sctp = { 120static BIO_METHOD methods_dgramp_sctp = {
123 BIO_TYPE_DGRAM_SCTP, 121 .type = BIO_TYPE_DGRAM_SCTP,
124 "datagram sctp socket", 122 .name = "datagram sctp socket",
125 dgram_sctp_write, 123 .bwrite = dgram_sctp_write,
126 dgram_sctp_read, 124 .bread = dgram_sctp_read,
127 dgram_sctp_puts, 125 .bputs = dgram_sctp_puts,
128 NULL, /* dgram_gets, */ 126 .ctrl = dgram_sctp_ctrl,
129 dgram_sctp_ctrl, 127 .create = dgram_sctp_new,
130 dgram_sctp_new, 128 .destroy = dgram_sctp_free
131 dgram_sctp_free,
132 NULL,
133}; 129};
134#endif 130#endif
135 131
diff --git a/src/lib/libcrypto/bio/bss_fd.c b/src/lib/libcrypto/bio/bss_fd.c
index 8ea80f1f65..04a88a155b 100644
--- a/src/lib/libcrypto/bio/bss_fd.c
+++ b/src/lib/libcrypto/bio/bss_fd.c
@@ -79,15 +79,15 @@ static int fd_free(BIO *data);
79int BIO_fd_should_retry(int s); 79int BIO_fd_should_retry(int s);
80 80
81static BIO_METHOD methods_fdp = { 81static BIO_METHOD methods_fdp = {
82 BIO_TYPE_FD, "file descriptor", 82 .type = BIO_TYPE_FD,
83 fd_write, 83 .name = "file descriptor",
84 fd_read, 84 .bwrite = fd_write,
85 fd_puts, 85 .bread = fd_read,
86 fd_gets, 86 .bputs = fd_puts,
87 fd_ctrl, 87 .bgets = fd_gets,
88 fd_new, 88 .ctrl = fd_ctrl,
89 fd_free, 89 .create = fd_new,
90 NULL, 90 .destroy = fd_free
91}; 91};
92 92
93BIO_METHOD * 93BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c
index 6d5444f666..6f81a45a47 100644
--- a/src/lib/libcrypto/bio/bss_file.c
+++ b/src/lib/libcrypto/bio/bss_file.c
@@ -100,16 +100,15 @@ static int file_new(BIO *h);
100static int file_free(BIO *data); 100static int file_free(BIO *data);
101 101
102static BIO_METHOD methods_filep = { 102static BIO_METHOD methods_filep = {
103 BIO_TYPE_FILE, 103 .type = BIO_TYPE_FILE,
104 "FILE pointer", 104 .name = "FILE pointer",
105 file_write, 105 .bwrite = file_write,
106 file_read, 106 .bread = file_read,
107 file_puts, 107 .bputs = file_puts,
108 file_gets, 108 .bgets = file_gets,
109 file_ctrl, 109 .ctrl = file_ctrl,
110 file_new, 110 .create = file_new,
111 file_free, 111 .destroy = file_free
112 NULL,
113}; 112};
114 113
115BIO * 114BIO *
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c
index 6aa2d8b0a4..ac1cbc5087 100644
--- a/src/lib/libcrypto/bio/bss_log.c
+++ b/src/lib/libcrypto/bio/bss_log.c
@@ -86,15 +86,13 @@ static void xsyslog(BIO* bp, int priority, const char* string);
86static void xcloselog(BIO* bp); 86static void xcloselog(BIO* bp);
87 87
88static BIO_METHOD methods_slg = { 88static BIO_METHOD methods_slg = {
89 BIO_TYPE_MEM, "syslog", 89 .type = BIO_TYPE_MEM,
90 slg_write, 90 .name = "syslog",
91 NULL, 91 .bwrite = slg_write,
92 slg_puts, 92 .bputs = slg_puts,
93 NULL, 93 .ctrl = slg_ctrl,
94 slg_ctrl, 94 .create = slg_new,
95 slg_new, 95 .destroy = slg_free
96 slg_free,
97 NULL,
98}; 96};
99 97
100BIO_METHOD * 98BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_mem.c b/src/lib/libcrypto/bio/bss_mem.c
index 1a477c12be..b147a8eccb 100644
--- a/src/lib/libcrypto/bio/bss_mem.c
+++ b/src/lib/libcrypto/bio/bss_mem.c
@@ -70,16 +70,15 @@ static int mem_new(BIO *h);
70static int mem_free(BIO *data); 70static int mem_free(BIO *data);
71 71
72static BIO_METHOD mem_method = { 72static BIO_METHOD mem_method = {
73 BIO_TYPE_MEM, 73 .type = BIO_TYPE_MEM,
74 "memory buffer", 74 .name = "memory buffer",
75 mem_write, 75 .bwrite = mem_write,
76 mem_read, 76 .bread = mem_read,
77 mem_puts, 77 .bputs = mem_puts,
78 mem_gets, 78 .bgets = mem_gets,
79 mem_ctrl, 79 .ctrl = mem_ctrl,
80 mem_new, 80 .create = mem_new,
81 mem_free, 81 .destroy = mem_free
82 NULL,
83}; 82};
84 83
85/* bio->num is used to hold the value to return on 'empty', if it is 84/* bio->num is used to hold the value to return on 'empty', if it is
diff --git a/src/lib/libcrypto/bio/bss_null.c b/src/lib/libcrypto/bio/bss_null.c
index c7289725d9..a5796ea87a 100644
--- a/src/lib/libcrypto/bio/bss_null.c
+++ b/src/lib/libcrypto/bio/bss_null.c
@@ -70,16 +70,15 @@ static int null_new(BIO *h);
70static int null_free(BIO *data); 70static int null_free(BIO *data);
71 71
72static BIO_METHOD null_method = { 72static BIO_METHOD null_method = {
73 BIO_TYPE_NULL, 73 .type = BIO_TYPE_NULL,
74 "NULL", 74 .name = "NULL",
75 null_write, 75 .bwrite = null_write,
76 null_read, 76 .bread = null_read,
77 null_puts, 77 .bputs = null_puts,
78 null_gets, 78 .bgets = null_gets,
79 null_ctrl, 79 .ctrl = null_ctrl,
80 null_new, 80 .create = null_new,
81 null_free, 81 .destroy = null_free
82 NULL,
83}; 82};
84 83
85BIO_METHOD * 84BIO_METHOD *
diff --git a/src/lib/libcrypto/bio/bss_sock.c b/src/lib/libcrypto/bio/bss_sock.c
index 3dae2562bf..757e1dbb8f 100644
--- a/src/lib/libcrypto/bio/bss_sock.c
+++ b/src/lib/libcrypto/bio/bss_sock.c
@@ -74,16 +74,14 @@ static int sock_free(BIO *data);
74int BIO_sock_should_retry(int s); 74int BIO_sock_should_retry(int s);
75 75
76static BIO_METHOD methods_sockp = { 76static BIO_METHOD methods_sockp = {
77 BIO_TYPE_SOCKET, 77 .type = BIO_TYPE_SOCKET,
78 "socket", 78 .name = "socket",
79 sock_write, 79 .bwrite = sock_write,
80 sock_read, 80 .bread = sock_read,
81 sock_puts, 81 .bputs = sock_puts,
82 NULL, /* sock_gets, */ 82 .ctrl = sock_ctrl,
83 sock_ctrl, 83 .create = sock_new,
84 sock_new, 84 .destroy = sock_free
85 sock_free,
86 NULL,
87}; 85};
88 86
89BIO_METHOD * 87BIO_METHOD *
diff --git a/src/lib/libcrypto/cmac/cm_ameth.c b/src/lib/libcrypto/cmac/cm_ameth.c
index 0b8e5670b0..c960e1cf43 100644
--- a/src/lib/libcrypto/cmac/cm_ameth.c
+++ b/src/lib/libcrypto/cmac/cm_ameth.c
@@ -73,25 +73,14 @@ static void cmac_key_free(EVP_PKEY *pkey)
73 CMAC_CTX_free(cmctx); 73 CMAC_CTX_free(cmctx);
74 } 74 }
75 75
76const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = 76const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = {
77 { 77 .pkey_id = EVP_PKEY_CMAC,
78 EVP_PKEY_CMAC, 78 .pkey_base_id = EVP_PKEY_CMAC,
79 EVP_PKEY_CMAC,
80 0,
81
82 "CMAC",
83 "OpenSSL CMAC method",
84
85 0,0,0,0,
86
87 0,0,0,
88 79
89 cmac_size, 80 .pem_str = "CMAC",
90 0, 81 .info = "OpenSSL CMAC method",
91 0,0,0,0,0,0,0,
92 82
93 cmac_key_free, 83 .pkey_size = cmac_size,
94 0, 84 .pkey_free = cmac_key_free
95 0,0 85};
96 };
97 86
diff --git a/src/lib/libcrypto/cmac/cm_pmeth.c b/src/lib/libcrypto/cmac/cm_pmeth.c
index 00aa4d64d2..e1a00e90bb 100644
--- a/src/lib/libcrypto/cmac/cm_pmeth.c
+++ b/src/lib/libcrypto/cmac/cm_pmeth.c
@@ -188,37 +188,19 @@ static int pkey_cmac_ctrl_str(EVP_PKEY_CTX *ctx,
188 return -2; 188 return -2;
189 } 189 }
190 190
191const EVP_PKEY_METHOD cmac_pkey_meth = 191const EVP_PKEY_METHOD cmac_pkey_meth = {
192 { 192 .pkey_id = EVP_PKEY_CMAC,
193 EVP_PKEY_CMAC, 193 .flags = EVP_PKEY_FLAG_SIGCTX_CUSTOM,
194 EVP_PKEY_FLAG_SIGCTX_CUSTOM,
195 pkey_cmac_init,
196 pkey_cmac_copy,
197 pkey_cmac_cleanup,
198
199 0, 0,
200
201 0,
202 pkey_cmac_keygen,
203
204 0, 0,
205
206 0, 0,
207
208 0,0,
209
210 cmac_signctx_init,
211 cmac_signctx,
212
213 0,0,
214
215 0,0,
216 194
217 0,0, 195 .init = pkey_cmac_init,
196 .copy = pkey_cmac_copy,
197 .cleanup = pkey_cmac_cleanup,
218 198
219 0,0, 199 .keygen = pkey_cmac_keygen,
220 200
221 pkey_cmac_ctrl, 201 .signctx_init = cmac_signctx_init,
222 pkey_cmac_ctrl_str 202 .signctx = cmac_signctx,
223 203
224 }; 204 .ctrl = pkey_cmac_ctrl,
205 .ctrl_str = pkey_cmac_ctrl_str
206};
diff --git a/src/lib/libcrypto/comp/c_rle.c b/src/lib/libcrypto/comp/c_rle.c
index 7a5db298c5..48e48cbb7a 100644
--- a/src/lib/libcrypto/comp/c_rle.c
+++ b/src/lib/libcrypto/comp/c_rle.c
@@ -10,14 +10,10 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
10 unsigned int olen, unsigned char *in, unsigned int ilen); 10 unsigned int olen, unsigned char *in, unsigned int ilen);
11 11
12static COMP_METHOD rle_method = { 12static COMP_METHOD rle_method = {
13 NID_rle_compression, 13 .type = NID_rle_compression,
14 LN_rle_compression, 14 .name = LN_rle_compression,
15 NULL, 15 .compress = rle_compress_block,
16 NULL, 16 .expand = rle_expand_block
17 rle_compress_block,
18 rle_expand_block,
19 NULL,
20 NULL,
21}; 17};
22 18
23COMP_METHOD * 19COMP_METHOD *
diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c
index 3a73b3df0b..26c6507cd5 100644
--- a/src/lib/libcrypto/comp/c_zlib.c
+++ b/src/lib/libcrypto/comp/c_zlib.c
@@ -8,14 +8,8 @@
8COMP_METHOD *COMP_zlib(void ); 8COMP_METHOD *COMP_zlib(void );
9 9
10static COMP_METHOD zlib_method_nozlib = { 10static COMP_METHOD zlib_method_nozlib = {
11 NID_undef, 11 .type = NID_undef,
12 "(undef)", 12 .name = "(undef)"
13 NULL,
14 NULL,
15 NULL,
16 NULL,
17 NULL,
18 NULL,
19}; 13};
20 14
21#ifndef ZLIB 15#ifndef ZLIB
@@ -55,26 +49,20 @@ static int zz_uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
55 uLong sourceLen); 49 uLong sourceLen);
56 50
57static COMP_METHOD zlib_stateless_method = { 51static COMP_METHOD zlib_stateless_method = {
58 NID_zlib_compression, 52 .type = NID_zlib_compression,
59 LN_zlib_compression, 53 .name = LN_zlib_compression,
60 NULL, 54 .compress = zlib_compress_block,
61 NULL, 55 .expand = zlib_expand_block
62 zlib_compress_block,
63 zlib_expand_block,
64 NULL,
65 NULL,
66}; 56};
67#endif 57#endif
68 58
69static COMP_METHOD zlib_stateful_method = { 59static COMP_METHOD zlib_stateful_method = {
70 NID_zlib_compression, 60 .type = NID_zlib_compression,
71 LN_zlib_compression, 61 .name = LN_zlib_compression,
72 zlib_stateful_init, 62 .init = zlib_stateful_init,
73 zlib_stateful_finish, 63 .finish = zlib_stateful_finish,
74 zlib_stateful_compress_block, 64 .compress = zlib_stateful_compress_block,
75 zlib_stateful_expand_block, 65 .expand = zlib_stateful_expand_block
76 NULL,
77 NULL,
78}; 66};
79 67
80#ifdef ZLIB_SHARED 68#ifdef ZLIB_SHARED
@@ -433,16 +421,14 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr);
433static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp); 421static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
434 422
435static BIO_METHOD bio_meth_zlib = { 423static BIO_METHOD bio_meth_zlib = {
436 BIO_TYPE_COMP, 424 .type = BIO_TYPE_COMP,
437 "zlib", 425 .name = "zlib",
438 bio_zlib_write, 426 .bwrite = bio_zlib_write,
439 bio_zlib_read, 427 .bread = bio_zlib_read,
440 NULL, 428 .ctrl = bio_zlib_ctrl,
441 NULL, 429 .create = bio_zlib_new,
442 bio_zlib_ctrl, 430 .destroy = bio_zlib_free,
443 bio_zlib_new, 431 .callback_ctrl = bio_zlib_callback_ctrl
444 bio_zlib_free,
445 bio_zlib_callback_ctrl
446}; 432};
447 433
448BIO_METHOD * 434BIO_METHOD *
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index d85773df0e..b3c75e1a9e 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -91,16 +91,16 @@ static int def_to_int(const CONF *conf, char c);
91const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT; 91const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
92 92
93static CONF_METHOD default_method = { 93static CONF_METHOD default_method = {
94 "OpenSSL default", 94 .name = "OpenSSL default",
95 def_create, 95 .create = def_create,
96 def_init_default, 96 .init = def_init_default,
97 def_destroy, 97 .destroy = def_destroy,
98 def_destroy_data, 98 .destroy_data = def_destroy_data,
99 def_load_bio, 99 .load_bio = def_load_bio,
100 def_dump, 100 .dump = def_dump,
101 def_is_number, 101 .is_number = def_is_number,
102 def_to_int, 102 .to_int = def_to_int,
103 def_load 103 .load = def_load
104}; 104};
105 105
106static CONF_METHOD WIN32_method = { 106static CONF_METHOD WIN32_method = {
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};
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c
index e9c549802d..ebca5ec5c5 100644
--- a/src/lib/libcrypto/dsa/dsa_ameth.c
+++ b/src/lib/libcrypto/dsa/dsa_ameth.c
@@ -640,65 +640,61 @@ static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
640 640
641/* NB these are sorted in pkey_id order, lowest first */ 641/* NB these are sorted in pkey_id order, lowest first */
642 642
643const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = 643const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = {
644 { 644 {
645 .pkey_id = EVP_PKEY_DSA2,
646 .pkey_base_id = EVP_PKEY_DSA,
647 .pkey_flags = ASN1_PKEY_ALIAS
648 },
645 649
646 { 650 {
647 EVP_PKEY_DSA2, 651 .pkey_id = EVP_PKEY_DSA1,
648 EVP_PKEY_DSA, 652 .pkey_base_id = EVP_PKEY_DSA,
649 ASN1_PKEY_ALIAS 653 .pkey_flags = ASN1_PKEY_ALIAS
650 }, 654 },
651
652 {
653 EVP_PKEY_DSA1,
654 EVP_PKEY_DSA,
655 ASN1_PKEY_ALIAS
656 },
657
658 {
659 EVP_PKEY_DSA4,
660 EVP_PKEY_DSA,
661 ASN1_PKEY_ALIAS
662 },
663 655
664 { 656 {
665 EVP_PKEY_DSA3, 657 .pkey_id = EVP_PKEY_DSA4,
666 EVP_PKEY_DSA, 658 .pkey_base_id = EVP_PKEY_DSA,
667 ASN1_PKEY_ALIAS 659 .pkey_flags = ASN1_PKEY_ALIAS
668 }, 660 },
669 661
670 { 662 {
671 EVP_PKEY_DSA, 663 .pkey_id = EVP_PKEY_DSA3,
672 EVP_PKEY_DSA, 664 .pkey_base_id = EVP_PKEY_DSA,
673 0, 665 .pkey_flags = ASN1_PKEY_ALIAS
674 666 },
675 "DSA",
676 "OpenSSL DSA method",
677
678 dsa_pub_decode,
679 dsa_pub_encode,
680 dsa_pub_cmp,
681 dsa_pub_print,
682
683 dsa_priv_decode,
684 dsa_priv_encode,
685 dsa_priv_print,
686
687 int_dsa_size,
688 dsa_bits,
689
690 dsa_param_decode,
691 dsa_param_encode,
692 dsa_missing_parameters,
693 dsa_copy_parameters,
694 dsa_cmp_parameters,
695 dsa_param_print,
696 dsa_sig_print,
697
698 int_dsa_free,
699 dsa_pkey_ctrl,
700 old_dsa_priv_decode,
701 old_dsa_priv_encode
702 }
703 };
704 667
668 {
669 .pkey_id = EVP_PKEY_DSA,
670 .pkey_base_id = EVP_PKEY_DSA,
671
672 .pem_str = "DSA",
673 .info = "OpenSSL DSA method",
674
675 .pub_decode = dsa_pub_decode,
676 .pub_encode = dsa_pub_encode,
677 .pub_cmp = dsa_pub_cmp,
678 .pub_print = dsa_pub_print,
679
680 .priv_decode = dsa_priv_decode,
681 .priv_encode = dsa_priv_encode,
682 .priv_print = dsa_priv_print,
683
684 .pkey_size = int_dsa_size,
685 .pkey_bits = dsa_bits,
686
687 .param_decode = dsa_param_decode,
688 .param_encode = dsa_param_encode,
689 .param_missing = dsa_missing_parameters,
690 .param_copy = dsa_copy_parameters,
691 .param_cmp = dsa_cmp_parameters,
692 .param_print = dsa_param_print,
693 .sig_print = dsa_sig_print,
694
695 .pkey_free = int_dsa_free,
696 .pkey_ctrl = dsa_pkey_ctrl,
697 .old_priv_decode = old_dsa_priv_decode,
698 .old_priv_encode = old_dsa_priv_encode
699 }
700};
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index b3d78e524c..7e0e3b006e 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -74,18 +74,12 @@ static int dsa_init(DSA *dsa);
74static int dsa_finish(DSA *dsa); 74static int dsa_finish(DSA *dsa);
75 75
76static DSA_METHOD openssl_dsa_meth = { 76static DSA_METHOD openssl_dsa_meth = {
77"OpenSSL DSA method", 77 .name = "OpenSSL DSA method",
78dsa_do_sign, 78 .dsa_do_sign = dsa_do_sign,
79dsa_sign_setup, 79 .dsa_sign_setup = dsa_sign_setup,
80dsa_do_verify, 80 .dsa_do_verify = dsa_do_verify,
81NULL, /* dsa_mod_exp, */ 81 .init = dsa_init,
82NULL, /* dsa_bn_mod_exp, */ 82 .finish = dsa_finish
83dsa_init,
84dsa_finish,
850,
86NULL,
87NULL,
88NULL
89}; 83};
90 84
91/* These macro wrappers replace attempts to use the dsa_mod_exp() and 85/* These macro wrappers replace attempts to use the dsa_mod_exp() and
diff --git a/src/lib/libcrypto/dsa/dsa_pmeth.c b/src/lib/libcrypto/dsa/dsa_pmeth.c
index 7076bf7b67..4e77c6f64b 100644
--- a/src/lib/libcrypto/dsa/dsa_pmeth.c
+++ b/src/lib/libcrypto/dsa/dsa_pmeth.c
@@ -281,38 +281,22 @@ static int pkey_dsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
281 return DSA_generate_key(pkey->pkey.dsa); 281 return DSA_generate_key(pkey->pkey.dsa);
282 } 282 }
283 283
284const EVP_PKEY_METHOD dsa_pkey_meth = 284const EVP_PKEY_METHOD dsa_pkey_meth = {
285 { 285 .pkey_id = EVP_PKEY_DSA,
286 EVP_PKEY_DSA, 286 .flags = EVP_PKEY_FLAG_AUTOARGLEN,
287 EVP_PKEY_FLAG_AUTOARGLEN,
288 pkey_dsa_init,
289 pkey_dsa_copy,
290 pkey_dsa_cleanup,
291
292 0,
293 pkey_dsa_paramgen,
294
295 0,
296 pkey_dsa_keygen,
297
298 0,
299 pkey_dsa_sign,
300
301 0,
302 pkey_dsa_verify,
303
304 0,0,
305
306 0,0,0,0,
307 287
308 0,0, 288 .init = pkey_dsa_init,
289 .copy = pkey_dsa_copy,
290 .cleanup = pkey_dsa_cleanup,
309 291
310 0,0, 292 .paramgen = pkey_dsa_paramgen,
311 293
312 0,0, 294 .keygen = pkey_dsa_keygen,
313 295
314 pkey_dsa_ctrl, 296 .sign = pkey_dsa_sign,
315 pkey_dsa_ctrl_str
316 297
298 .verify = pkey_dsa_verify,
317 299
318 }; 300 .ctrl = pkey_dsa_ctrl,
301 .ctrl_str = pkey_dsa_ctrl_str
302};
diff --git a/src/lib/libcrypto/dso/dso_dlfcn.c b/src/lib/libcrypto/dso/dso_dlfcn.c
index 6cf9ab2667..bebfdcdbc4 100644
--- a/src/lib/libcrypto/dso/dso_dlfcn.c
+++ b/src/lib/libcrypto/dso/dso_dlfcn.c
@@ -93,23 +93,15 @@ static int dlfcn_pathbyaddr(void *addr, char *path, int sz);
93static void *dlfcn_globallookup(const char *name); 93static void *dlfcn_globallookup(const char *name);
94 94
95static DSO_METHOD dso_meth_dlfcn = { 95static DSO_METHOD dso_meth_dlfcn = {
96 "OpenSSL 'dlfcn' shared library method", 96 .name = "OpenSSL 'dlfcn' shared library method",
97 dlfcn_load, 97 .dso_load = dlfcn_load,
98 dlfcn_unload, 98 .dso_unload = dlfcn_unload,
99 dlfcn_bind_var, 99 .dso_bind_var = dlfcn_bind_var,
100 dlfcn_bind_func, 100 .dso_bind_func = dlfcn_bind_func,
101/* For now, "unbind" doesn't exist */ 101 .dso_name_converter = dlfcn_name_converter,
102#if 0 102 .dso_merger = dlfcn_merger,
103 NULL, /* unbind_var */ 103 .pathbyaddr = dlfcn_pathbyaddr,
104 NULL, /* unbind_func */ 104 .globallookup = dlfcn_globallookup
105#endif
106 NULL, /* ctrl */
107 dlfcn_name_converter,
108 dlfcn_merger,
109 NULL, /* init */
110 NULL, /* finish */
111 dlfcn_pathbyaddr,
112 dlfcn_globallookup
113}; 105};
114 106
115DSO_METHOD * 107DSO_METHOD *
diff --git a/src/lib/libcrypto/dso/dso_null.c b/src/lib/libcrypto/dso/dso_null.c
index 0c877ab2f2..c9f4226cb5 100644
--- a/src/lib/libcrypto/dso/dso_null.c
+++ b/src/lib/libcrypto/dso/dso_null.c
@@ -64,23 +64,7 @@
64#include <openssl/dso.h> 64#include <openssl/dso.h>
65 65
66static DSO_METHOD dso_meth_null = { 66static DSO_METHOD dso_meth_null = {
67 "NULL shared library method", 67 .name = "NULL shared library method"
68 NULL, /* load */
69 NULL, /* unload */
70 NULL, /* bind_var */
71 NULL, /* bind_func */
72/* For now, "unbind" doesn't exist */
73#if 0
74 NULL, /* unbind_var */
75 NULL, /* unbind_func */
76#endif
77 NULL, /* ctrl */
78 NULL, /* dso_name_converter */
79 NULL, /* dso_merger */
80 NULL, /* init */
81 NULL, /* finish */
82 NULL, /* pathbyaddr */
83 NULL /* globallookup */
84}; 68};
85 69
86DSO_METHOD * 70DSO_METHOD *
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c
index 0cf681fa9d..5682bfab37 100644
--- a/src/lib/libcrypto/ec/ec2_smpl.c
+++ b/src/lib/libcrypto/ec/ec2_smpl.c
@@ -73,52 +73,51 @@
73 73
74#ifndef OPENSSL_NO_EC2M 74#ifndef OPENSSL_NO_EC2M
75 75
76const EC_METHOD *EC_GF2m_simple_method(void) 76const EC_METHOD *
77 { 77EC_GF2m_simple_method(void)
78{
78 static const EC_METHOD ret = { 79 static const EC_METHOD ret = {
79 EC_FLAGS_DEFAULT_OCT, 80 .flags = EC_FLAGS_DEFAULT_OCT,
80 NID_X9_62_characteristic_two_field, 81 .field_type = NID_X9_62_characteristic_two_field,
81 ec_GF2m_simple_group_init, 82 .group_init = ec_GF2m_simple_group_init,
82 ec_GF2m_simple_group_finish, 83 .group_finish = ec_GF2m_simple_group_finish,
83 ec_GF2m_simple_group_clear_finish, 84 .group_clear_finish = ec_GF2m_simple_group_clear_finish,
84 ec_GF2m_simple_group_copy, 85 .group_copy = ec_GF2m_simple_group_copy,
85 ec_GF2m_simple_group_set_curve, 86 .group_set_curve = ec_GF2m_simple_group_set_curve,
86 ec_GF2m_simple_group_get_curve, 87 .group_get_curve = ec_GF2m_simple_group_get_curve,
87 ec_GF2m_simple_group_get_degree, 88 .group_get_degree = ec_GF2m_simple_group_get_degree,
88 ec_GF2m_simple_group_check_discriminant, 89 .group_check_discriminant =
89 ec_GF2m_simple_point_init, 90 ec_GF2m_simple_group_check_discriminant,
90 ec_GF2m_simple_point_finish, 91 .point_init = ec_GF2m_simple_point_init,
91 ec_GF2m_simple_point_clear_finish, 92 .point_finish = ec_GF2m_simple_point_finish,
92 ec_GF2m_simple_point_copy, 93 .point_clear_finish = ec_GF2m_simple_point_clear_finish,
93 ec_GF2m_simple_point_set_to_infinity, 94 .point_copy = ec_GF2m_simple_point_copy,
94 0 /* set_Jprojective_coordinates_GFp */, 95 .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity,
95 0 /* get_Jprojective_coordinates_GFp */, 96 .point_set_affine_coordinates =
96 ec_GF2m_simple_point_set_affine_coordinates, 97 ec_GF2m_simple_point_set_affine_coordinates,
97 ec_GF2m_simple_point_get_affine_coordinates, 98 .point_get_affine_coordinates =
98 0,0,0, 99 ec_GF2m_simple_point_get_affine_coordinates,
99 ec_GF2m_simple_add, 100 .add = ec_GF2m_simple_add,
100 ec_GF2m_simple_dbl, 101 .dbl = ec_GF2m_simple_dbl,
101 ec_GF2m_simple_invert, 102 .invert = ec_GF2m_simple_invert,
102 ec_GF2m_simple_is_at_infinity, 103 .is_at_infinity = ec_GF2m_simple_is_at_infinity,
103 ec_GF2m_simple_is_on_curve, 104 .is_on_curve = ec_GF2m_simple_is_on_curve,
104 ec_GF2m_simple_cmp, 105 .point_cmp = ec_GF2m_simple_cmp,
105 ec_GF2m_simple_make_affine, 106 .make_affine = ec_GF2m_simple_make_affine,
106 ec_GF2m_simple_points_make_affine, 107 .points_make_affine = ec_GF2m_simple_points_make_affine,
107 108
108 /* the following three method functions are defined in ec2_mult.c */ 109 /* the following three method functions are defined in ec2_mult.c */
109 ec_GF2m_simple_mul, 110 .mul = ec_GF2m_simple_mul,
110 ec_GF2m_precompute_mult, 111 .precompute_mult = ec_GF2m_precompute_mult,
111 ec_GF2m_have_precompute_mult, 112 .have_precompute_mult = ec_GF2m_have_precompute_mult,
112 113
113 ec_GF2m_simple_field_mul, 114 .field_mul = ec_GF2m_simple_field_mul,
114 ec_GF2m_simple_field_sqr, 115 .field_sqr = ec_GF2m_simple_field_sqr,
115 ec_GF2m_simple_field_div, 116 .field_div = ec_GF2m_simple_field_div,
116 0 /* field_encode */, 117 };
117 0 /* field_decode */,
118 0 /* field_set_to_one */ };
119 118
120 return &ret; 119 return &ret;
121 } 120}
122 121
123 122
124/* Initialize a GF(2^m)-based EC_GROUP structure. 123/* Initialize a GF(2^m)-based EC_GROUP structure.
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 79dd11083e..0e6381f543 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -626,36 +626,34 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
626 626
627 } 627 }
628 628
629const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = 629const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
630 { 630 .pkey_id = EVP_PKEY_EC,
631 EVP_PKEY_EC, 631 .pkey_base_id = EVP_PKEY_EC,
632 EVP_PKEY_EC, 632
633 0, 633 .pem_str = "EC",
634 "EC", 634 .info = "OpenSSL EC algorithm",
635 "OpenSSL EC algorithm", 635
636 636 .pub_decode = eckey_pub_decode,
637 eckey_pub_decode, 637 .pub_encode = eckey_pub_encode,
638 eckey_pub_encode, 638 .pub_cmp = eckey_pub_cmp,
639 eckey_pub_cmp, 639 .pub_print = eckey_pub_print,
640 eckey_pub_print, 640
641 641 .priv_decode = eckey_priv_decode,
642 eckey_priv_decode, 642 .priv_encode = eckey_priv_encode,
643 eckey_priv_encode, 643 .priv_print = eckey_priv_print,
644 eckey_priv_print, 644
645 645 .pkey_size = int_ec_size,
646 int_ec_size, 646 .pkey_bits = ec_bits,
647 ec_bits, 647
648 648 .param_decode = eckey_param_decode,
649 eckey_param_decode, 649 .param_encode = eckey_param_encode,
650 eckey_param_encode, 650 .param_missing = ec_missing_parameters,
651 ec_missing_parameters, 651 .param_copy = ec_copy_parameters,
652 ec_copy_parameters, 652 .param_cmp = ec_cmp_parameters,
653 ec_cmp_parameters, 653 .param_print = eckey_param_print,
654 eckey_param_print, 654
655 0, 655 .pkey_free = int_ec_free,
656 656 .pkey_ctrl = ec_pkey_ctrl,
657 int_ec_free, 657 .old_priv_decode = old_ec_priv_decode,
658 ec_pkey_ctrl, 658 .old_priv_encode = old_ec_priv_encode
659 old_ec_priv_decode, 659};
660 old_ec_priv_encode
661 };
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c
index dfc8ace27b..c970d8c9ca 100644
--- a/src/lib/libcrypto/ec/ec_pmeth.c
+++ b/src/lib/libcrypto/ec/ec_pmeth.c
@@ -304,38 +304,23 @@ static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
304 return EC_KEY_generate_key(pkey->pkey.ec); 304 return EC_KEY_generate_key(pkey->pkey.ec);
305 } 305 }
306 306
307const EVP_PKEY_METHOD ec_pkey_meth = 307const EVP_PKEY_METHOD ec_pkey_meth = {
308 { 308 .pkey_id = EVP_PKEY_EC,
309 EVP_PKEY_EC,
310 0,
311 pkey_ec_init,
312 pkey_ec_copy,
313 pkey_ec_cleanup,
314
315 0,
316 pkey_ec_paramgen,
317
318 0,
319 pkey_ec_keygen,
320
321 0,
322 pkey_ec_sign,
323
324 0,
325 pkey_ec_verify,
326 309
327 0,0, 310 .init = pkey_ec_init,
311 .copy = pkey_ec_copy,
312 .cleanup = pkey_ec_cleanup,
328 313
329 0,0,0,0, 314 .paramgen = pkey_ec_paramgen,
330 315
331 0,0, 316 .keygen = pkey_ec_keygen,
332 317
333 0,0, 318 .sign = pkey_ec_sign,
334 319
335 0, 320 .verify = pkey_ec_verify,
336 pkey_ec_derive,
337 321
338 pkey_ec_ctrl, 322 .derive = pkey_ec_derive,
339 pkey_ec_ctrl_str
340 323
341 }; 324 .ctrl = pkey_ec_ctrl,
325 .ctrl_str = pkey_ec_ctrl_str
326};
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c
index cee0fee12a..6b5b856344 100644
--- a/src/lib/libcrypto/ec/ecp_mont.c
+++ b/src/lib/libcrypto/ec/ecp_mont.c
@@ -66,49 +66,51 @@
66#include "ec_lcl.h" 66#include "ec_lcl.h"
67 67
68 68
69const EC_METHOD *EC_GFp_mont_method(void) 69const EC_METHOD *
70 { 70EC_GFp_mont_method(void)
71{
71 static const EC_METHOD ret = { 72 static const EC_METHOD ret = {
72 EC_FLAGS_DEFAULT_OCT, 73 .flags = EC_FLAGS_DEFAULT_OCT,
73 NID_X9_62_prime_field, 74 .field_type = NID_X9_62_prime_field,
74 ec_GFp_mont_group_init, 75 .group_init = ec_GFp_mont_group_init,
75 ec_GFp_mont_group_finish, 76 .group_finish = ec_GFp_mont_group_finish,
76 ec_GFp_mont_group_clear_finish, 77 .group_clear_finish = ec_GFp_mont_group_clear_finish,
77 ec_GFp_mont_group_copy, 78 .group_copy = ec_GFp_mont_group_copy,
78 ec_GFp_mont_group_set_curve, 79 .group_set_curve = ec_GFp_mont_group_set_curve,
79 ec_GFp_simple_group_get_curve, 80 .group_get_curve = ec_GFp_simple_group_get_curve,
80 ec_GFp_simple_group_get_degree, 81 .group_get_degree = ec_GFp_simple_group_get_degree,
81 ec_GFp_simple_group_check_discriminant, 82 .group_check_discriminant =
82 ec_GFp_simple_point_init, 83 ec_GFp_simple_group_check_discriminant,
83 ec_GFp_simple_point_finish, 84 .point_init = ec_GFp_simple_point_init,
84 ec_GFp_simple_point_clear_finish, 85 .point_finish = ec_GFp_simple_point_finish,
85 ec_GFp_simple_point_copy, 86 .point_clear_finish = ec_GFp_simple_point_clear_finish,
86 ec_GFp_simple_point_set_to_infinity, 87 .point_copy = ec_GFp_simple_point_copy,
87 ec_GFp_simple_set_Jprojective_coordinates_GFp, 88 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
88 ec_GFp_simple_get_Jprojective_coordinates_GFp, 89 .point_set_Jprojective_coordinates_GFp =
89 ec_GFp_simple_point_set_affine_coordinates, 90 ec_GFp_simple_set_Jprojective_coordinates_GFp,
90 ec_GFp_simple_point_get_affine_coordinates, 91 .point_get_Jprojective_coordinates_GFp =
91 0,0,0, 92 ec_GFp_simple_get_Jprojective_coordinates_GFp,
92 ec_GFp_simple_add, 93 .point_set_affine_coordinates =
93 ec_GFp_simple_dbl, 94 ec_GFp_simple_point_set_affine_coordinates,
94 ec_GFp_simple_invert, 95 .point_get_affine_coordinates =
95 ec_GFp_simple_is_at_infinity, 96 ec_GFp_simple_point_get_affine_coordinates,
96 ec_GFp_simple_is_on_curve, 97 .add = ec_GFp_simple_add,
97 ec_GFp_simple_cmp, 98 .dbl = ec_GFp_simple_dbl,
98 ec_GFp_simple_make_affine, 99 .invert = ec_GFp_simple_invert,
99 ec_GFp_simple_points_make_affine, 100 .is_at_infinity = ec_GFp_simple_is_at_infinity,
100 0 /* mul */, 101 .is_on_curve = ec_GFp_simple_is_on_curve,
101 0 /* precompute_mult */, 102 .point_cmp = ec_GFp_simple_cmp,
102 0 /* have_precompute_mult */, 103 .make_affine = ec_GFp_simple_make_affine,
103 ec_GFp_mont_field_mul, 104 .points_make_affine = ec_GFp_simple_points_make_affine,
104 ec_GFp_mont_field_sqr, 105 .field_mul = ec_GFp_mont_field_mul,
105 0 /* field_div */, 106 .field_sqr = ec_GFp_mont_field_sqr,
106 ec_GFp_mont_field_encode, 107 .field_encode = ec_GFp_mont_field_encode,
107 ec_GFp_mont_field_decode, 108 .field_decode = ec_GFp_mont_field_decode,
108 ec_GFp_mont_field_set_to_one }; 109 .field_set_to_one = ec_GFp_mont_field_set_to_one
110 };
109 111
110 return &ret; 112 return &ret;
111 } 113}
112 114
113 115
114int ec_GFp_mont_group_init(EC_GROUP *group) 116int ec_GFp_mont_group_init(EC_GROUP *group)
diff --git a/src/lib/libcrypto/ec/ecp_nist.c b/src/lib/libcrypto/ec/ecp_nist.c
index ac5b814238..479cff8fc9 100644
--- a/src/lib/libcrypto/ec/ecp_nist.c
+++ b/src/lib/libcrypto/ec/ecp_nist.c
@@ -67,49 +67,48 @@
67#include <openssl/obj_mac.h> 67#include <openssl/obj_mac.h>
68#include "ec_lcl.h" 68#include "ec_lcl.h"
69 69
70const EC_METHOD *EC_GFp_nist_method(void) 70const EC_METHOD *
71 { 71EC_GFp_nist_method(void)
72{
72 static const EC_METHOD ret = { 73 static const EC_METHOD ret = {
73 EC_FLAGS_DEFAULT_OCT, 74 .flags = EC_FLAGS_DEFAULT_OCT,
74 NID_X9_62_prime_field, 75 .field_type = NID_X9_62_prime_field,
75 ec_GFp_simple_group_init, 76 .group_init = ec_GFp_simple_group_init,
76 ec_GFp_simple_group_finish, 77 .group_finish = ec_GFp_simple_group_finish,
77 ec_GFp_simple_group_clear_finish, 78 .group_clear_finish = ec_GFp_simple_group_clear_finish,
78 ec_GFp_nist_group_copy, 79 .group_copy = ec_GFp_nist_group_copy,
79 ec_GFp_nist_group_set_curve, 80 .group_set_curve = ec_GFp_nist_group_set_curve,
80 ec_GFp_simple_group_get_curve, 81 .group_get_curve = ec_GFp_simple_group_get_curve,
81 ec_GFp_simple_group_get_degree, 82 .group_get_degree = ec_GFp_simple_group_get_degree,
82 ec_GFp_simple_group_check_discriminant, 83 .group_check_discriminant =
83 ec_GFp_simple_point_init, 84 ec_GFp_simple_group_check_discriminant,
84 ec_GFp_simple_point_finish, 85 .point_init = ec_GFp_simple_point_init,
85 ec_GFp_simple_point_clear_finish, 86 .point_finish = ec_GFp_simple_point_finish,
86 ec_GFp_simple_point_copy, 87 .point_clear_finish = ec_GFp_simple_point_clear_finish,
87 ec_GFp_simple_point_set_to_infinity, 88 .point_copy = ec_GFp_simple_point_copy,
88 ec_GFp_simple_set_Jprojective_coordinates_GFp, 89 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
89 ec_GFp_simple_get_Jprojective_coordinates_GFp, 90 .point_set_Jprojective_coordinates_GFp =
90 ec_GFp_simple_point_set_affine_coordinates, 91 ec_GFp_simple_set_Jprojective_coordinates_GFp,
91 ec_GFp_simple_point_get_affine_coordinates, 92 .point_get_Jprojective_coordinates_GFp =
92 0,0,0, 93 ec_GFp_simple_get_Jprojective_coordinates_GFp,
93 ec_GFp_simple_add, 94 .point_set_affine_coordinates =
94 ec_GFp_simple_dbl, 95 ec_GFp_simple_point_set_affine_coordinates,
95 ec_GFp_simple_invert, 96 .point_get_affine_coordinates =
96 ec_GFp_simple_is_at_infinity, 97 ec_GFp_simple_point_get_affine_coordinates,
97 ec_GFp_simple_is_on_curve, 98 .add = ec_GFp_simple_add,
98 ec_GFp_simple_cmp, 99 .dbl = ec_GFp_simple_dbl,
99 ec_GFp_simple_make_affine, 100 .invert = ec_GFp_simple_invert,
100 ec_GFp_simple_points_make_affine, 101 .is_at_infinity = ec_GFp_simple_is_at_infinity,
101 0 /* mul */, 102 .is_on_curve = ec_GFp_simple_is_on_curve,
102 0 /* precompute_mult */, 103 .point_cmp = ec_GFp_simple_cmp,
103 0 /* have_precompute_mult */, 104 .make_affine = ec_GFp_simple_make_affine,
104 ec_GFp_nist_field_mul, 105 .points_make_affine = ec_GFp_simple_points_make_affine,
105 ec_GFp_nist_field_sqr, 106 .field_mul = ec_GFp_nist_field_mul,
106 0 /* field_div */, 107 .field_sqr = ec_GFp_nist_field_sqr
107 0 /* field_encode */, 108 };
108 0 /* field_decode */,
109 0 /* field_set_to_one */ };
110 109
111 return &ret; 110 return &ret;
112 } 111}
113 112
114int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src) 113int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
115 { 114 {
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c
index 03f2d9c1d7..696024a549 100644
--- a/src/lib/libcrypto/ec/ecp_nistp224.c
+++ b/src/lib/libcrypto/ec/ecp_nistp224.c
@@ -233,51 +233,51 @@ typedef struct {
233 int references; 233 int references;
234} NISTP224_PRE_COMP; 234} NISTP224_PRE_COMP;
235 235
236const EC_METHOD *EC_GFp_nistp224_method(void) 236const EC_METHOD *
237 { 237EC_GFp_nistp224_method(void)
238{
238 static const EC_METHOD ret = { 239 static const EC_METHOD ret = {
239 EC_FLAGS_DEFAULT_OCT, 240 .flags = EC_FLAGS_DEFAULT_OCT,
240 NID_X9_62_prime_field, 241 .field_type = NID_X9_62_prime_field,
241 ec_GFp_nistp224_group_init, 242 .group_init = ec_GFp_nistp224_group_init,
242 ec_GFp_simple_group_finish, 243 .group_finish = ec_GFp_simple_group_finish,
243 ec_GFp_simple_group_clear_finish, 244 .group_clear_finish = ec_GFp_simple_group_clear_finish,
244 ec_GFp_nist_group_copy, 245 .group_copy = ec_GFp_nist_group_copy,
245 ec_GFp_nistp224_group_set_curve, 246 .group_set_curve = ec_GFp_nistp224_group_set_curve,
246 ec_GFp_simple_group_get_curve, 247 .group_get_curve = ec_GFp_simple_group_get_curve,
247 ec_GFp_simple_group_get_degree, 248 .group_get_degree = ec_GFp_simple_group_get_degree,
248 ec_GFp_simple_group_check_discriminant, 249 .group_check_discriminant =
249 ec_GFp_simple_point_init, 250 ec_GFp_simple_group_check_discriminant,
250 ec_GFp_simple_point_finish, 251 .point_init = ec_GFp_simple_point_init,
251 ec_GFp_simple_point_clear_finish, 252 .point_finish = ec_GFp_simple_point_finish,
252 ec_GFp_simple_point_copy, 253 .point_clear_finish = ec_GFp_simple_point_clear_finish,
253 ec_GFp_simple_point_set_to_infinity, 254 .point_copy = ec_GFp_simple_point_copy,
254 ec_GFp_simple_set_Jprojective_coordinates_GFp, 255 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
255 ec_GFp_simple_get_Jprojective_coordinates_GFp, 256 .point_set_Jprojective_coordinates_GFp =
256 ec_GFp_simple_point_set_affine_coordinates, 257 ec_GFp_simple_set_Jprojective_coordinates_GFp,
257 ec_GFp_nistp224_point_get_affine_coordinates, 258 .point_get_Jprojective_coordinates_GFp =
258 0 /* point_set_compressed_coordinates */, 259 ec_GFp_simple_get_Jprojective_coordinates_GFp,
259 0 /* point2oct */, 260 .point_set_affine_coordinates =
260 0 /* oct2point */, 261 ec_GFp_simple_point_set_affine_coordinates,
261 ec_GFp_simple_add, 262 .point_get_affine_coordinates =
262 ec_GFp_simple_dbl, 263 ec_GFp_nistp224_point_get_affine_coordinates,
263 ec_GFp_simple_invert, 264 .add = ec_GFp_simple_add,
264 ec_GFp_simple_is_at_infinity, 265 .dbl = ec_GFp_simple_dbl,
265 ec_GFp_simple_is_on_curve, 266 .invert = ec_GFp_simple_invert,
266 ec_GFp_simple_cmp, 267 .is_at_infinity = ec_GFp_simple_is_at_infinity,
267 ec_GFp_simple_make_affine, 268 .is_on_curve = ec_GFp_simple_is_on_curve,
268 ec_GFp_simple_points_make_affine, 269 .point_cmp = ec_GFp_simple_cmp,
269 ec_GFp_nistp224_points_mul, 270 .make_affine = ec_GFp_simple_make_affine,
270 ec_GFp_nistp224_precompute_mult, 271 .points_make_affine = ec_GFp_simple_points_make_affine,
271 ec_GFp_nistp224_have_precompute_mult, 272 .mul = ec_GFp_nistp224_points_mul,
272 ec_GFp_nist_field_mul, 273 .precompute_mult = ec_GFp_nistp224_precompute_mult,
273 ec_GFp_nist_field_sqr, 274 .have_precompute_mult = ec_GFp_nistp224_have_precompute_mult,
274 0 /* field_div */, 275 .field_mul = ec_GFp_nist_field_mul,
275 0 /* field_encode */, 276 .field_sqr = ec_GFp_nist_field_sqr
276 0 /* field_decode */, 277 };
277 0 /* field_set_to_one */ };
278 278
279 return &ret; 279 return &ret;
280 } 280}
281 281
282/* Helper functions to convert field elements to/from internal representation */ 282/* Helper functions to convert field elements to/from internal representation */
283static void bin28_to_felem(felem out, const u8 in[28]) 283static void bin28_to_felem(felem out, const u8 in[28])
diff --git a/src/lib/libcrypto/ec/ecp_nistp256.c b/src/lib/libcrypto/ec/ecp_nistp256.c
index 947fb7eee0..132ca0d250 100644
--- a/src/lib/libcrypto/ec/ecp_nistp256.c
+++ b/src/lib/libcrypto/ec/ecp_nistp256.c
@@ -1613,51 +1613,51 @@ typedef struct {
1613 int references; 1613 int references;
1614} NISTP256_PRE_COMP; 1614} NISTP256_PRE_COMP;
1615 1615
1616const EC_METHOD *EC_GFp_nistp256_method(void) 1616const EC_METHOD *
1617 { 1617EC_GFp_nistp256_method(void)
1618{
1618 static const EC_METHOD ret = { 1619 static const EC_METHOD ret = {
1619 EC_FLAGS_DEFAULT_OCT, 1620 .flags = EC_FLAGS_DEFAULT_OCT,
1620 NID_X9_62_prime_field, 1621 .field_type = NID_X9_62_prime_field,
1621 ec_GFp_nistp256_group_init, 1622 .group_init = ec_GFp_nistp256_group_init,
1622 ec_GFp_simple_group_finish, 1623 .group_finish = ec_GFp_simple_group_finish,
1623 ec_GFp_simple_group_clear_finish, 1624 .group_clear_finish = ec_GFp_simple_group_clear_finish,
1624 ec_GFp_nist_group_copy, 1625 .group_copy = ec_GFp_nist_group_copy,
1625 ec_GFp_nistp256_group_set_curve, 1626 .group_set_curve = ec_GFp_nistp256_group_set_curve,
1626 ec_GFp_simple_group_get_curve, 1627 .group_get_curve = ec_GFp_simple_group_get_curve,
1627 ec_GFp_simple_group_get_degree, 1628 .group_get_degree = ec_GFp_simple_group_get_degree,
1628 ec_GFp_simple_group_check_discriminant, 1629 .group_check_discriminant =
1629 ec_GFp_simple_point_init, 1630 ec_GFp_simple_group_check_discriminant,
1630 ec_GFp_simple_point_finish, 1631 .point_init = ec_GFp_simple_point_init,
1631 ec_GFp_simple_point_clear_finish, 1632 .point_finish = ec_GFp_simple_point_finish,
1632 ec_GFp_simple_point_copy, 1633 .point_clear_finish = ec_GFp_simple_point_clear_finish,
1633 ec_GFp_simple_point_set_to_infinity, 1634 .point_copy = ec_GFp_simple_point_copy,
1634 ec_GFp_simple_set_Jprojective_coordinates_GFp, 1635 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
1635 ec_GFp_simple_get_Jprojective_coordinates_GFp, 1636 .point_set_Jprojective_coordinates_GFp =
1636 ec_GFp_simple_point_set_affine_coordinates, 1637 ec_GFp_simple_set_Jprojective_coordinates_GFp,
1637 ec_GFp_nistp256_point_get_affine_coordinates, 1638 .point_get_Jprojective_coordinates_GFp =
1638 0 /* point_set_compressed_coordinates */, 1639 ec_GFp_simple_get_Jprojective_coordinates_GFp,
1639 0 /* point2oct */, 1640 .point_set_affine_coordinates =
1640 0 /* oct2point */, 1641 ec_GFp_simple_point_set_affine_coordinates,
1641 ec_GFp_simple_add, 1642 .point_get_affine_coordinates =
1642 ec_GFp_simple_dbl, 1643 ec_GFp_nistp256_point_get_affine_coordinates,
1643 ec_GFp_simple_invert, 1644 .add = ec_GFp_simple_add,
1644 ec_GFp_simple_is_at_infinity, 1645 .dbl = ec_GFp_simple_dbl,
1645 ec_GFp_simple_is_on_curve, 1646 .invert = ec_GFp_simple_invert,
1646 ec_GFp_simple_cmp, 1647 .is_at_infinity = ec_GFp_simple_is_at_infinity,
1647 ec_GFp_simple_make_affine, 1648 .is_on_curve = ec_GFp_simple_is_on_curve,
1648 ec_GFp_simple_points_make_affine, 1649 .point_cmp = ec_GFp_simple_cmp,
1649 ec_GFp_nistp256_points_mul, 1650 .make_affine = ec_GFp_simple_make_affine,
1650 ec_GFp_nistp256_precompute_mult, 1651 .points_make_affine = ec_GFp_simple_points_make_affine,
1651 ec_GFp_nistp256_have_precompute_mult, 1652 .mul = ec_GFp_nistp256_points_mul,
1652 ec_GFp_nist_field_mul, 1653 .precompute_mult = ec_GFp_nistp256_precompute_mult,
1653 ec_GFp_nist_field_sqr, 1654 .have_precompute_mult = ec_GFp_nistp256_have_precompute_mult,
1654 0 /* field_div */, 1655 .field_mul = ec_GFp_nist_field_mul,
1655 0 /* field_encode */, 1656 .field_sqr = ec_GFp_nist_field_sqr
1656 0 /* field_decode */, 1657 };
1657 0 /* field_set_to_one */ };
1658 1658
1659 return &ret; 1659 return &ret;
1660 } 1660}
1661 1661
1662/******************************************************************************/ 1662/******************************************************************************/
1663/* FUNCTIONS TO MANAGE PRECOMPUTATION 1663/* FUNCTIONS TO MANAGE PRECOMPUTATION
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c
index 24eb032951..c34c38b7e8 100644
--- a/src/lib/libcrypto/ec/ecp_nistp521.c
+++ b/src/lib/libcrypto/ec/ecp_nistp521.c
@@ -1479,51 +1479,51 @@ typedef struct {
1479 int references; 1479 int references;
1480} NISTP521_PRE_COMP; 1480} NISTP521_PRE_COMP;
1481 1481
1482const EC_METHOD *EC_GFp_nistp521_method(void) 1482const EC_METHOD *
1483 { 1483EC_GFp_nistp521_method(void)
1484{
1484 static const EC_METHOD ret = { 1485 static const EC_METHOD ret = {
1485 EC_FLAGS_DEFAULT_OCT, 1486 .flags = EC_FLAGS_DEFAULT_OCT,
1486 NID_X9_62_prime_field, 1487 .field_type = NID_X9_62_prime_field,
1487 ec_GFp_nistp521_group_init, 1488 .group_init = ec_GFp_nistp521_group_init,
1488 ec_GFp_simple_group_finish, 1489 .group_finish = ec_GFp_simple_group_finish,
1489 ec_GFp_simple_group_clear_finish, 1490 .group_clear_finish = ec_GFp_simple_group_clear_finish,
1490 ec_GFp_nist_group_copy, 1491 .group_copy = ec_GFp_nist_group_copy,
1491 ec_GFp_nistp521_group_set_curve, 1492 .group_set_curve = ec_GFp_nistp521_group_set_curve,
1492 ec_GFp_simple_group_get_curve, 1493 .group_get_curve = ec_GFp_simple_group_get_curve,
1493 ec_GFp_simple_group_get_degree, 1494 .group_get_degree = ec_GFp_simple_group_get_degree,
1494 ec_GFp_simple_group_check_discriminant, 1495 .group_check_discriminant =
1495 ec_GFp_simple_point_init, 1496 ec_GFp_simple_group_check_discriminant,
1496 ec_GFp_simple_point_finish, 1497 .point_init = ec_GFp_simple_point_init,
1497 ec_GFp_simple_point_clear_finish, 1498 .point_finish = ec_GFp_simple_point_finish,
1498 ec_GFp_simple_point_copy, 1499 .point_clear_finish = ec_GFp_simple_point_clear_finish,
1499 ec_GFp_simple_point_set_to_infinity, 1500 .point_copy = ec_GFp_simple_point_copy,
1500 ec_GFp_simple_set_Jprojective_coordinates_GFp, 1501 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
1501 ec_GFp_simple_get_Jprojective_coordinates_GFp, 1502 .point_set_Jprojective_coordinates_GFp =
1502 ec_GFp_simple_point_set_affine_coordinates, 1503 ec_GFp_simple_set_Jprojective_coordinates_GFp,
1503 ec_GFp_nistp521_point_get_affine_coordinates, 1504 .point_get_Jprojective_coordinates_GFp =
1504 0 /* point_set_compressed_coordinates */, 1505 ec_GFp_simple_get_Jprojective_coordinates_GFp,
1505 0 /* point2oct */, 1506 .point_set_affine_coordinates =
1506 0 /* oct2point */, 1507 ec_GFp_simple_point_set_affine_coordinates,
1507 ec_GFp_simple_add, 1508 .point_get_affine_coordinates =
1508 ec_GFp_simple_dbl, 1509 ec_GFp_nistp521_point_get_affine_coordinates,
1509 ec_GFp_simple_invert, 1510 .add = ec_GFp_simple_add,
1510 ec_GFp_simple_is_at_infinity, 1511 .dbl = ec_GFp_simple_dbl,
1511 ec_GFp_simple_is_on_curve, 1512 .invert = ec_GFp_simple_invert,
1512 ec_GFp_simple_cmp, 1513 .is_at_infinity = ec_GFp_simple_is_at_infinity,
1513 ec_GFp_simple_make_affine, 1514 .is_on_curve = ec_GFp_simple_is_on_curve,
1514 ec_GFp_simple_points_make_affine, 1515 .point_cmp = ec_GFp_simple_cmp,
1515 ec_GFp_nistp521_points_mul, 1516 .make_affine = ec_GFp_simple_make_affine,
1516 ec_GFp_nistp521_precompute_mult, 1517 .points_make_affine = ec_GFp_simple_points_make_affine,
1517 ec_GFp_nistp521_have_precompute_mult, 1518 .mul = ec_GFp_nistp521_points_mul,
1518 ec_GFp_nist_field_mul, 1519 .precompute_mult = ec_GFp_nistp521_precompute_mult,
1519 ec_GFp_nist_field_sqr, 1520 .have_precompulte_mult = ec_GFp_nistp521_have_precompute_mult,
1520 0 /* field_div */, 1521 .field_mul = ec_GFp_nist_field_mul,
1521 0 /* field_encode */, 1522 .field_sqr = ec_GFp_nist_field_sqr
1522 0 /* field_decode */, 1523 };
1523 0 /* field_set_to_one */ };
1524 1524
1525 return &ret; 1525 return &ret;
1526 } 1526}
1527 1527
1528 1528
1529/******************************************************************************/ 1529/******************************************************************************/
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c
index a146752817..c99348f08f 100644
--- a/src/lib/libcrypto/ec/ecp_smpl.c
+++ b/src/lib/libcrypto/ec/ecp_smpl.c
@@ -66,49 +66,48 @@
66 66
67#include "ec_lcl.h" 67#include "ec_lcl.h"
68 68
69const EC_METHOD *EC_GFp_simple_method(void) 69const EC_METHOD *
70 { 70EC_GFp_simple_method(void)
71{
71 static const EC_METHOD ret = { 72 static const EC_METHOD ret = {
72 EC_FLAGS_DEFAULT_OCT, 73 .flags = EC_FLAGS_DEFAULT_OCT,
73 NID_X9_62_prime_field, 74 .field_type = NID_X9_62_prime_field,
74 ec_GFp_simple_group_init, 75 .group_init = ec_GFp_simple_group_init,
75 ec_GFp_simple_group_finish, 76 .group_finish = ec_GFp_simple_group_finish,
76 ec_GFp_simple_group_clear_finish, 77 .group_clear_finish = ec_GFp_simple_group_clear_finish,
77 ec_GFp_simple_group_copy, 78 .group_copy = ec_GFp_simple_group_copy,
78 ec_GFp_simple_group_set_curve, 79 .group_set_curve = ec_GFp_simple_group_set_curve,
79 ec_GFp_simple_group_get_curve, 80 .group_get_curve = ec_GFp_simple_group_get_curve,
80 ec_GFp_simple_group_get_degree, 81 .group_get_degree = ec_GFp_simple_group_get_degree,
81 ec_GFp_simple_group_check_discriminant, 82 .group_check_discriminant =
82 ec_GFp_simple_point_init, 83 ec_GFp_simple_group_check_discriminant,
83 ec_GFp_simple_point_finish, 84 .point_init = ec_GFp_simple_point_init,
84 ec_GFp_simple_point_clear_finish, 85 .point_finish = ec_GFp_simple_point_finish,
85 ec_GFp_simple_point_copy, 86 .point_clear_finish = ec_GFp_simple_point_clear_finish,
86 ec_GFp_simple_point_set_to_infinity, 87 .point_copy = ec_GFp_simple_point_copy,
87 ec_GFp_simple_set_Jprojective_coordinates_GFp, 88 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
88 ec_GFp_simple_get_Jprojective_coordinates_GFp, 89 .point_set_Jprojective_coordinates_GFp =
89 ec_GFp_simple_point_set_affine_coordinates, 90 ec_GFp_simple_set_Jprojective_coordinates_GFp,
90 ec_GFp_simple_point_get_affine_coordinates, 91 .point_get_Jprojective_coordinates_GFp =
91 0,0,0, 92 ec_GFp_simple_get_Jprojective_coordinates_GFp,
92 ec_GFp_simple_add, 93 .point_set_affine_coordinates =
93 ec_GFp_simple_dbl, 94 ec_GFp_simple_point_set_affine_coordinates,
94 ec_GFp_simple_invert, 95 .point_get_affine_coordinates =
95 ec_GFp_simple_is_at_infinity, 96 ec_GFp_simple_point_get_affine_coordinates,
96 ec_GFp_simple_is_on_curve, 97 .add = ec_GFp_simple_add,
97 ec_GFp_simple_cmp, 98 .dbl = ec_GFp_simple_dbl,
98 ec_GFp_simple_make_affine, 99 .invert = ec_GFp_simple_invert,
99 ec_GFp_simple_points_make_affine, 100 .is_at_infinity = ec_GFp_simple_is_at_infinity,
100 0 /* mul */, 101 .is_on_curve = ec_GFp_simple_is_on_curve,
101 0 /* precompute_mult */, 102 .point_cmp = ec_GFp_simple_cmp,
102 0 /* have_precompute_mult */, 103 .make_affine = ec_GFp_simple_make_affine,
103 ec_GFp_simple_field_mul, 104 .points_make_affine = ec_GFp_simple_points_make_affine,
104 ec_GFp_simple_field_sqr, 105 .field_mul = ec_GFp_simple_field_mul,
105 0 /* field_div */, 106 .field_sqr = ec_GFp_simple_field_sqr
106 0 /* field_encode */, 107 };
107 0 /* field_decode */,
108 0 /* field_set_to_one */ };
109 108
110 return &ret; 109 return &ret;
111 } 110}
112 111
113 112
114/* Most method functions in this file are designed to work with 113/* Most method functions in this file are designed to work with
diff --git a/src/lib/libcrypto/ecdh/ech_ossl.c b/src/lib/libcrypto/ecdh/ech_ossl.c
index a63eb4922d..129475f7bb 100644
--- a/src/lib/libcrypto/ecdh/ech_ossl.c
+++ b/src/lib/libcrypto/ecdh/ech_ossl.c
@@ -84,14 +84,8 @@ static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
84 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); 84 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));
85 85
86static ECDH_METHOD openssl_ecdh_meth = { 86static ECDH_METHOD openssl_ecdh_meth = {
87 "OpenSSL ECDH method", 87 .name = "OpenSSL ECDH method",
88 ecdh_compute_key, 88 .compute_key = ecdh_compute_key
89#if 0
90 NULL, /* init */
91 NULL, /* finish */
92#endif
93 0, /* flags */
94 NULL /* app_data */
95}; 89};
96 90
97const ECDH_METHOD *ECDH_OpenSSL(void) 91const ECDH_METHOD *ECDH_OpenSSL(void)
diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c
index 7725935610..4a6e04e946 100644
--- a/src/lib/libcrypto/ecdsa/ecs_ossl.c
+++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c
@@ -69,16 +69,10 @@ static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
69 const ECDSA_SIG *sig, EC_KEY *eckey); 69 const ECDSA_SIG *sig, EC_KEY *eckey);
70 70
71static ECDSA_METHOD openssl_ecdsa_meth = { 71static ECDSA_METHOD openssl_ecdsa_meth = {
72 "OpenSSL ECDSA method", 72 .name = "OpenSSL ECDSA method",
73 ecdsa_do_sign, 73 .ecdsa_do_sign = ecdsa_do_sign,
74 ecdsa_sign_setup, 74 .ecdsa_sign_setup = ecdsa_sign_setup,
75 ecdsa_do_verify, 75 .ecdsa_do_verify = ecdsa_do_verify
76#if 0
77 NULL, /* init */
78 NULL, /* finish */
79#endif
80 0, /* flags */
81 NULL /* app_data */
82}; 76};
83 77
84const ECDSA_METHOD *ECDSA_OpenSSL(void) 78const ECDSA_METHOD *ECDSA_OpenSSL(void)
diff --git a/src/lib/libcrypto/engine/eng_padlock.c b/src/lib/libcrypto/engine/eng_padlock.c
index d5d9a16bf2..c27181ba75 100644
--- a/src/lib/libcrypto/engine/eng_padlock.c
+++ b/src/lib/libcrypto/engine/eng_padlock.c
@@ -1086,12 +1086,9 @@ padlock_rand_status(void)
1086 1086
1087/* Prepare structure for registration */ 1087/* Prepare structure for registration */
1088static RAND_METHOD padlock_rand = { 1088static RAND_METHOD padlock_rand = {
1089 NULL, /* seed */ 1089 .bytes = padlock_rand_bytes,
1090 padlock_rand_bytes, /* bytes */ 1090 .pseudorand = padlock_rand_bytes,
1091 NULL, /* cleanup */ 1091 .status = padlock_rand_status
1092 NULL, /* add */
1093 padlock_rand_bytes, /* pseudorand */
1094 padlock_rand_status, /* rand status */
1095}; 1092};
1096 1093
1097#else /* !COMPILE_HW_PADLOCK */ 1094#else /* !COMPILE_HW_PADLOCK */
diff --git a/src/lib/libcrypto/engine/eng_rdrand.c b/src/lib/libcrypto/engine/eng_rdrand.c
index 4e9e91d54b..ba1b5bfbff 100644
--- a/src/lib/libcrypto/engine/eng_rdrand.c
+++ b/src/lib/libcrypto/engine/eng_rdrand.c
@@ -84,15 +84,11 @@ static int get_random_bytes (unsigned char *buf, int num)
84static int random_status (void) 84static int random_status (void)
85{ return 1; } 85{ return 1; }
86 86
87static RAND_METHOD rdrand_meth = 87static RAND_METHOD rdrand_meth = {
88 { 88 .bytes = get_random_bytes,
89 NULL, /* seed */ 89 .pseudorand = get_random_bytes,
90 get_random_bytes, 90 .status = random_status
91 NULL, /* cleanup */ 91};
92 NULL, /* add */
93 get_random_bytes,
94 random_status,
95 };
96 92
97static int rdrand_init(ENGINE *e) 93static int rdrand_init(ENGINE *e)
98{ return 1; } 94{ return 1; }
diff --git a/src/lib/libcrypto/engine/eng_rsax.c b/src/lib/libcrypto/engine/eng_rsax.c
index fa9159499d..c0f6851601 100644
--- a/src/lib/libcrypto/engine/eng_rsax.c
+++ b/src/lib/libcrypto/engine/eng_rsax.c
@@ -116,22 +116,12 @@ static const ENGINE_CMD_DEFN e_rsax_cmd_defns[] = {
116 116
117#ifndef OPENSSL_NO_RSA 117#ifndef OPENSSL_NO_RSA
118/* Our internal RSA_METHOD that we provide pointers to */ 118/* Our internal RSA_METHOD that we provide pointers to */
119static RSA_METHOD e_rsax_rsa = 119static RSA_METHOD e_rsax_rsa = {
120 { 120 .name = "Intel RSA-X method",
121 "Intel RSA-X method", 121 .rsa_mod_exp = e_rsax_rsa_mod_exp,
122 NULL, 122 .finish = e_rsax_rsa_finish,
123 NULL, 123 .flags = RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
124 NULL, 124};
125 NULL,
126 e_rsax_rsa_mod_exp,
127 NULL,
128 NULL,
129 e_rsax_rsa_finish,
130 RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
131 NULL,
132 NULL,
133 NULL
134 };
135#endif 125#endif
136 126
137/* Constants used when creating the ENGINE */ 127/* Constants used when creating the ENGINE */
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c
index 190dcc4f75..9b24511b69 100644
--- a/src/lib/libcrypto/engine/hw_cryptodev.c
+++ b/src/lib/libcrypto/engine/hw_cryptodev.c
@@ -1039,19 +1039,7 @@ err:
1039} 1039}
1040 1040
1041static RSA_METHOD cryptodev_rsa = { 1041static RSA_METHOD cryptodev_rsa = {
1042 "cryptodev RSA method", 1042 .name = "cryptodev RSA method"
1043 NULL, /* rsa_pub_enc */
1044 NULL, /* rsa_pub_dec */
1045 NULL, /* rsa_priv_enc */
1046 NULL, /* rsa_priv_dec */
1047 NULL,
1048 NULL,
1049 NULL, /* init */
1050 NULL, /* finish */
1051 0, /* flags */
1052 NULL, /* app_data */
1053 NULL, /* rsa_sign */
1054 NULL /* rsa_verify */
1055}; 1043};
1056 1044
1057static int 1045static int
@@ -1181,16 +1169,7 @@ err:
1181} 1169}
1182 1170
1183static DSA_METHOD cryptodev_dsa = { 1171static DSA_METHOD cryptodev_dsa = {
1184 "cryptodev DSA method", 1172 .name = "cryptodev DSA method"
1185 NULL,
1186 NULL, /* dsa_sign_setup */
1187 NULL,
1188 NULL, /* dsa_mod_exp */
1189 NULL,
1190 NULL, /* init */
1191 NULL, /* finish */
1192 0, /* flags */
1193 NULL /* app_data */
1194}; 1173};
1195 1174
1196static int 1175static int
@@ -1244,14 +1223,7 @@ err:
1244} 1223}
1245 1224
1246static DH_METHOD cryptodev_dh = { 1225static DH_METHOD cryptodev_dh = {
1247 "cryptodev DH method", 1226 .name = "cryptodev DH method"
1248 NULL, /* cryptodev_dh_generate_key */
1249 NULL,
1250 NULL,
1251 NULL,
1252 NULL,
1253 0, /* flags */
1254 NULL /* app_data */
1255}; 1227};
1256 1228
1257/* 1229/*
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 27fc587ca8..02631ec05a 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -91,18 +91,17 @@ typedef struct b64_struct
91 char tmp[B64_BLOCK_SIZE]; 91 char tmp[B64_BLOCK_SIZE];
92 } BIO_B64_CTX; 92 } BIO_B64_CTX;
93 93
94static BIO_METHOD methods_b64= 94static BIO_METHOD methods_b64= {
95 { 95 .type = BIO_TYPE_BASE64,
96 BIO_TYPE_BASE64,"base64 encoding", 96 .name = "base64 encoding",
97 b64_write, 97 .bwrite = b64_write,
98 b64_read, 98 .bread = b64_read,
99 b64_puts, 99 .bputs = b64_puts,
100 NULL, /* b64_gets, */ 100 .ctrl = b64_ctrl,
101 b64_ctrl, 101 .create = b64_new,
102 b64_new, 102 .destroy = b64_free,
103 b64_free, 103 .callback_ctrl = b64_callback_ctrl
104 b64_callback_ctrl, 104};
105 };
106 105
107BIO_METHOD *BIO_f_base64(void) 106BIO_METHOD *BIO_f_base64(void)
108 { 107 {
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 8fe9a45e48..3362c25768 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -87,18 +87,16 @@ typedef struct enc_struct
87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2]; 87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
88 } BIO_ENC_CTX; 88 } BIO_ENC_CTX;
89 89
90static BIO_METHOD methods_enc= 90static BIO_METHOD methods_enc= {
91 { 91 .type = BIO_TYPE_CIPHER,
92 BIO_TYPE_CIPHER,"cipher", 92 .name = "cipher",
93 enc_write, 93 .bwrite = enc_write,
94 enc_read, 94 .bread = enc_read,
95 NULL, /* enc_puts, */ 95 .ctrl = enc_ctrl,
96 NULL, /* enc_gets, */ 96 .create = enc_new,
97 enc_ctrl, 97 .destroy = enc_free,
98 enc_new, 98 .callback_ctrl = enc_callback_ctrl
99 enc_free, 99};
100 enc_callback_ctrl,
101 };
102 100
103BIO_METHOD *BIO_f_cipher(void) 101BIO_METHOD *BIO_f_cipher(void)
104 { 102 {
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index 144fdfd56a..85eead6c95 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -74,18 +74,17 @@ static int md_new(BIO *h);
74static int md_free(BIO *data); 74static int md_free(BIO *data);
75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp); 75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
76 76
77static BIO_METHOD methods_md= 77static BIO_METHOD methods_md = {
78 { 78 .type = BIO_TYPE_MD,
79 BIO_TYPE_MD,"message digest", 79 .name = "message digest",
80 md_write, 80 .bwrite = md_write,
81 md_read, 81 .bread = md_read,
82 NULL, /* md_puts, */ 82 .bgets = md_gets,
83 md_gets, 83 .ctrl = md_ctrl,
84 md_ctrl, 84 .create = md_new,
85 md_new, 85 .destroy = md_free,
86 md_free, 86 .callback_ctrl = md_callback_ctrl
87 md_callback_ctrl, 87};
88 };
89 88
90BIO_METHOD *BIO_f_md(void) 89BIO_METHOD *BIO_f_md(void)
91 { 90 {
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c
index 09a762ffac..d0bcbc2bef 100644
--- a/src/lib/libcrypto/evp/bio_ok.c
+++ b/src/lib/libcrypto/evp/bio_ok.c
@@ -157,18 +157,16 @@ typedef struct ok_struct
157 unsigned char buf[IOBS]; 157 unsigned char buf[IOBS];
158 } BIO_OK_CTX; 158 } BIO_OK_CTX;
159 159
160static BIO_METHOD methods_ok= 160static BIO_METHOD methods_ok = {
161 { 161 .type = BIO_TYPE_CIPHER,
162 BIO_TYPE_CIPHER,"reliable", 162 .name = "reliable",
163 ok_write, 163 .bwrite = ok_write,
164 ok_read, 164 .bread = ok_read,
165 NULL, /* ok_puts, */ 165 .ctrl = ok_ctrl,
166 NULL, /* ok_gets, */ 166 .create = ok_new,
167 ok_ctrl, 167 .destroy = ok_free,
168 ok_new, 168 .callback_ctrl = ok_callback_ctrl
169 ok_free, 169};
170 ok_callback_ctrl,
171 };
172 170
173BIO_METHOD *BIO_f_reliable(void) 171BIO_METHOD *BIO_f_reliable(void)
174 { 172 {
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c
index fbada40d9c..0625b06651 100644
--- a/src/lib/libcrypto/hmac/hm_ameth.c
+++ b/src/lib/libcrypto/hmac/hm_ameth.c
@@ -138,30 +138,20 @@ static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder)
138 138
139#endif 139#endif
140 140
141const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = 141const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
142 { 142 .pkey_id = EVP_PKEY_HMAC,
143 EVP_PKEY_HMAC, 143 .pkey_base_id = EVP_PKEY_HMAC,
144 EVP_PKEY_HMAC,
145 0,
146
147 "HMAC",
148 "OpenSSL HMAC method",
149
150 0,0,0,0,
151 144
152 0,0,0, 145 .pem_str = "HMAC",
146 .info = "OpenSSL HMAC method",
153 147
154 hmac_size, 148 .pkey_size = hmac_size,
155 0,
156 0,0,0,0,0,0,0,
157 149
158 hmac_key_free, 150 .pkey_free = hmac_key_free,
159 hmac_pkey_ctrl, 151 .pkey_ctrl = hmac_pkey_ctrl,
160#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT 152#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
161 old_hmac_decode, 153 .old_priv_decode = old_hmac_decode,
162 old_hmac_encode 154 .old_priv_encode = old_hmac_encode
163#else
164 0,0
165#endif 155#endif
166 }; 156 };
167 157
diff --git a/src/lib/libcrypto/hmac/hm_pmeth.c b/src/lib/libcrypto/hmac/hm_pmeth.c
index f1c67329d0..4d287724c3 100644
--- a/src/lib/libcrypto/hmac/hm_pmeth.c
+++ b/src/lib/libcrypto/hmac/hm_pmeth.c
@@ -235,37 +235,18 @@ static int pkey_hmac_ctrl_str(EVP_PKEY_CTX *ctx,
235 return -2; 235 return -2;
236 } 236 }
237 237
238const EVP_PKEY_METHOD hmac_pkey_meth = 238const EVP_PKEY_METHOD hmac_pkey_meth = {
239 { 239 .pkey_id = EVP_PKEY_HMAC,
240 EVP_PKEY_HMAC,
241 0,
242 pkey_hmac_init,
243 pkey_hmac_copy,
244 pkey_hmac_cleanup,
245
246 0, 0,
247
248 0,
249 pkey_hmac_keygen,
250
251 0, 0,
252
253 0, 0,
254
255 0,0,
256
257 hmac_signctx_init,
258 hmac_signctx,
259
260 0,0,
261
262 0,0,
263 240
264 0,0, 241 .init = pkey_hmac_init,
242 .copy = pkey_hmac_copy,
243 .cleanup = pkey_hmac_cleanup,
265 244
266 0,0, 245 .keygen = pkey_hmac_keygen,
267 246
268 pkey_hmac_ctrl, 247 .signctx_init = hmac_signctx_init,
269 pkey_hmac_ctrl_str 248 .signctx = hmac_signctx,
270 249
271 }; 250 .ctrl = pkey_hmac_ctrl,
251 .ctrl_str = pkey_hmac_ctrl_str
252};
diff --git a/src/lib/libcrypto/pkcs7/bio_ber.c b/src/lib/libcrypto/pkcs7/bio_ber.c
index d787495a21..216d237b4d 100644
--- a/src/lib/libcrypto/pkcs7/bio_ber.c
+++ b/src/lib/libcrypto/pkcs7/bio_ber.c
@@ -106,18 +106,16 @@ typedef struct bio_ber_struct
106 unsigned char buf[BER_BUF_SIZE]; 106 unsigned char buf[BER_BUF_SIZE];
107 } BIO_BER_CTX; 107 } BIO_BER_CTX;
108 108
109static BIO_METHOD methods_ber= 109static BIO_METHOD methods_ber = {
110 { 110 .type = BIO_TYPE_CIPHER,
111 BIO_TYPE_CIPHER,"cipher", 111 .name = "cipher",
112 ber_write, 112 .bwrite = ber_write,
113 ber_read, 113 .bread = ber_read,
114 NULL, /* ber_puts, */ 114 .ctrl = ber_ctrl,
115 NULL, /* ber_gets, */ 115 .create = ber_new,
116 ber_ctrl, 116 .destroy = ber_free,
117 ber_new, 117 .callback_ctrl = ber_callback_ctrl
118 ber_free, 118};
119 ber_callback_ctrl,
120 };
121 119
122BIO_METHOD *BIO_f_ber(void) 120BIO_METHOD *BIO_f_ber(void)
123 { 121 {
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c
index fdd11835ad..f0a346a70e 100644
--- a/src/lib/libcrypto/rsa/rsa_ameth.c
+++ b/src/lib/libcrypto/rsa/rsa_ameth.c
@@ -657,42 +657,40 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
657 return 2; 657 return 2;
658 } 658 }
659 659
660const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = 660const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
661 { 661 {
662 { 662 .pkey_id = EVP_PKEY_RSA,
663 EVP_PKEY_RSA, 663 .pkey_base_id = EVP_PKEY_RSA,
664 EVP_PKEY_RSA, 664 .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
665 ASN1_PKEY_SIGPARAM_NULL,
666 665
667 "RSA", 666 .pem_str = "RSA",
668 "OpenSSL RSA method", 667 .info = "OpenSSL RSA method",
669 668
670 rsa_pub_decode, 669 .pub_decode = rsa_pub_decode,
671 rsa_pub_encode, 670 .pub_encode = rsa_pub_encode,
672 rsa_pub_cmp, 671 .pub_cmp = rsa_pub_cmp,
673 rsa_pub_print, 672 .pub_print = rsa_pub_print,
674 673
675 rsa_priv_decode, 674 .priv_decode = rsa_priv_decode,
676 rsa_priv_encode, 675 .priv_encode = rsa_priv_encode,
677 rsa_priv_print, 676 .priv_print = rsa_priv_print,
678 677
679 int_rsa_size, 678 .pkey_size = int_rsa_size,
680 rsa_bits, 679 .pkey_bits = rsa_bits,
681 680
682 0,0,0,0,0,0, 681 .sig_print = rsa_sig_print,
683 682
684 rsa_sig_print, 683 .pkey_free = int_rsa_free,
685 int_rsa_free, 684 .pkey_ctrl = rsa_pkey_ctrl,
686 rsa_pkey_ctrl, 685 .old_priv_decode = old_rsa_priv_decode,
687 old_rsa_priv_decode, 686 .old_priv_encode = old_rsa_priv_encode,
688 old_rsa_priv_encode, 687 .item_verify = rsa_item_verify,
689 rsa_item_verify, 688 .item_sign = rsa_item_sign
690 rsa_item_sign 689 },
691 },
692 690
693 { 691 {
694 EVP_PKEY_RSA2, 692 .pkey_id = EVP_PKEY_RSA2,
695 EVP_PKEY_RSA, 693 .pkey_base_id = EVP_PKEY_RSA,
696 ASN1_PKEY_ALIAS 694 .pkey_flags = ASN1_PKEY_ALIAS
697 } 695 }
698 }; 696};
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index dcf0c16a8f..845e28877e 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -128,22 +128,17 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
128static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); 128static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
129static int RSA_eay_init(RSA *rsa); 129static int RSA_eay_init(RSA *rsa);
130static int RSA_eay_finish(RSA *rsa); 130static int RSA_eay_finish(RSA *rsa);
131static RSA_METHOD rsa_pkcs1_eay_meth={ 131static RSA_METHOD rsa_pkcs1_eay_meth = {
132 "Eric Young's PKCS#1 RSA", 132 .name = "Eric Young's PKCS#1 RSA",
133 RSA_eay_public_encrypt, 133 .rsa_pub_enc = RSA_eay_public_encrypt,
134 RSA_eay_public_decrypt, /* signature verification */ 134 .rsa_pub_dec = RSA_eay_public_decrypt, /* signature verification */
135 RSA_eay_private_encrypt, /* signing */ 135 .rsa_priv_enc = RSA_eay_private_encrypt, /* signing */
136 RSA_eay_private_decrypt, 136 .rsa_priv_dec = RSA_eay_private_decrypt,
137 RSA_eay_mod_exp, 137 .rsa_mod_exp = RSA_eay_mod_exp,
138 BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */ 138 .bn_mod_exp = BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
139 RSA_eay_init, 139 .init = RSA_eay_init,
140 RSA_eay_finish, 140 .finish = RSA_eay_finish,
141 0, /* flags */ 141};
142 NULL,
143 0, /* rsa_sign */
144 0, /* rsa_verify */
145 NULL /* rsa_keygen */
146 };
147 142
148const RSA_METHOD *RSA_PKCS1_SSLeay(void) 143const RSA_METHOD *RSA_PKCS1_SSLeay(void)
149 { 144 {
diff --git a/src/lib/libcrypto/rsa/rsa_null.c b/src/lib/libcrypto/rsa/rsa_null.c
index 2f2202f142..5b9317cb6c 100644
--- a/src/lib/libcrypto/rsa/rsa_null.c
+++ b/src/lib/libcrypto/rsa/rsa_null.c
@@ -82,22 +82,15 @@ static int RSA_null_mod_exp(const BIGNUM *r0, const BIGNUM *i, RSA *rsa);
82#endif 82#endif
83static int RSA_null_init(RSA *rsa); 83static int RSA_null_init(RSA *rsa);
84static int RSA_null_finish(RSA *rsa); 84static int RSA_null_finish(RSA *rsa);
85static RSA_METHOD rsa_null_meth={ 85static RSA_METHOD rsa_null_meth = {
86 "Null RSA", 86 .name = "Null RSA",
87 RSA_null_public_encrypt, 87 .rsa_pub_enc = RSA_null_public_encrypt,
88 RSA_null_public_decrypt, 88 .rsa_pub_dec = RSA_null_public_decrypt,
89 RSA_null_private_encrypt, 89 .rsa_priv_enc = RSA_null_private_encrypt,
90 RSA_null_private_decrypt, 90 .rsa_priv_dec = RSA_null_private_decrypt,
91 NULL, 91 .init = RSA_null_init,
92 NULL, 92 .finish = RSA_null_finish,
93 RSA_null_init, 93};
94 RSA_null_finish,
95 0,
96 NULL,
97 NULL,
98 NULL,
99 NULL
100 };
101 94
102const RSA_METHOD *RSA_null_method(void) 95const RSA_METHOD *RSA_null_method(void)
103 { 96 {
diff --git a/src/lib/libcrypto/rsa/rsa_pmeth.c b/src/lib/libcrypto/rsa/rsa_pmeth.c
index adec632b3b..09ef090172 100644
--- a/src/lib/libcrypto/rsa/rsa_pmeth.c
+++ b/src/lib/libcrypto/rsa/rsa_pmeth.c
@@ -609,41 +609,26 @@ static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
609 return ret; 609 return ret;
610 } 610 }
611 611
612const EVP_PKEY_METHOD rsa_pkey_meth = 612const EVP_PKEY_METHOD rsa_pkey_meth = {
613 { 613 .pkey_id = EVP_PKEY_RSA,
614 EVP_PKEY_RSA, 614 .flags = EVP_PKEY_FLAG_AUTOARGLEN,
615 EVP_PKEY_FLAG_AUTOARGLEN,
616 pkey_rsa_init,
617 pkey_rsa_copy,
618 pkey_rsa_cleanup,
619
620 0,0,
621
622 0,
623 pkey_rsa_keygen,
624
625 0,
626 pkey_rsa_sign,
627
628 0,
629 pkey_rsa_verify,
630
631 0,
632 pkey_rsa_verifyrecover,
633 615
616 .init = pkey_rsa_init,
617 .copy = pkey_rsa_copy,
618 .cleanup = pkey_rsa_cleanup,
634 619
635 0,0,0,0, 620 .keygen = pkey_rsa_keygen,
636 621
637 0, 622 .sign = pkey_rsa_sign,
638 pkey_rsa_encrypt,
639 623
640 0, 624 .verify = pkey_rsa_verify,
641 pkey_rsa_decrypt,
642 625
643 0,0, 626 .verify_recover = pkey_rsa_verifyrecover,
644 627
645 pkey_rsa_ctrl, 628 .encrypt = pkey_rsa_encrypt,
646 pkey_rsa_ctrl_str
647 629
630 .decrypt = pkey_rsa_decrypt,
648 631
649 }; 632 .ctrl = pkey_rsa_ctrl,
633 .ctrl_str = pkey_rsa_ctrl_str
634};
diff --git a/src/lib/libcrypto/store/str_mem.c b/src/lib/libcrypto/store/str_mem.c
index 997e60fe93..a73279c86b 100644
--- a/src/lib/libcrypto/store/str_mem.c
+++ b/src/lib/libcrypto/store/str_mem.c
@@ -133,25 +133,22 @@ static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[],
133 OPENSSL_ITEM parameters[]); 133 OPENSSL_ITEM parameters[]);
134static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void)); 134static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void));
135 135
136static STORE_METHOD store_memory = 136static STORE_METHOD store_memory = {
137 { 137 .name = "OpenSSL memory store interface",
138 "OpenSSL memory store interface", 138 .init = mem_init,
139 mem_init, 139 .clean = mem_clean,
140 mem_clean, 140 .generate_object = mem_generate,
141 mem_generate, 141 .get_object = mem_get,
142 mem_get, 142 .store_object = mem_store,
143 mem_store, 143 .modify_object = mem_modify,
144 mem_modify, 144 .delete_object = mem_delete,
145 NULL, /* revoke */ 145 .list_object_start = mem_list_start,
146 mem_delete, 146 .list_object_next = mem_list_next,
147 mem_list_start, 147 .list_object_end = mem_list_end,
148 mem_list_next, 148 .list_object_endp = mem_list_endp,
149 mem_list_end, 149 .lock_store = mem_lock,
150 mem_list_endp, 150 .unlock_store = mem_unlock,
151 NULL, /* update */ 151 .ctrl = mem_ctrl
152 mem_lock,
153 mem_unlock,
154 mem_ctrl
155 }; 152 };
156 153
157const STORE_METHOD *STORE_Memory(void) 154const STORE_METHOD *STORE_Memory(void)
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c
index d3be332f19..3b79ecaf02 100644
--- a/src/lib/libcrypto/ui/ui_openssl.c
+++ b/src/lib/libcrypto/ui/ui_openssl.c
@@ -157,13 +157,11 @@ static int noecho_console(UI *ui);
157static int close_console(UI *ui); 157static int close_console(UI *ui);
158 158
159static UI_METHOD ui_openssl = { 159static UI_METHOD ui_openssl = {
160 "OpenSSL default user interface", 160 .name = "OpenSSL default user interface",
161 open_console, 161 .ui_open_session = open_console,
162 write_string, 162 .ui_write_string = write_string,
163 NULL, /* No flusher is needed for command lines */ 163 .ui_read_string = read_string,
164 read_string, 164 .ui_close_session = close_console,
165 close_console,
166 NULL
167}; 165};
168 166
169/* The method with all the built-in thingies */ 167/* The method with all the built-in thingies */
diff --git a/src/lib/libssl/src/crypto/asn1/bio_asn1.c b/src/lib/libssl/src/crypto/asn1/bio_asn1.c
index 36b82758ed..327355eeda 100644
--- a/src/lib/libssl/src/crypto/asn1/bio_asn1.c
+++ b/src/lib/libssl/src/crypto/asn1/bio_asn1.c
@@ -124,16 +124,16 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
124 asn1_bio_state_t other_state); 124 asn1_bio_state_t other_state);
125 125
126static BIO_METHOD methods_asn1 = { 126static BIO_METHOD methods_asn1 = {
127 BIO_TYPE_ASN1, 127 .type = BIO_TYPE_ASN1,
128 "asn1", 128 .name = "asn1",
129 asn1_bio_write, 129 .bwrite = asn1_bio_write,
130 asn1_bio_read, 130 .bread = asn1_bio_read,
131 asn1_bio_puts, 131 .bputs = asn1_bio_puts,
132 asn1_bio_gets, 132 .bgets = asn1_bio_gets,
133 asn1_bio_ctrl, 133 .ctrl = asn1_bio_ctrl,
134 asn1_bio_new, 134 .create = asn1_bio_new,
135 asn1_bio_free, 135 .destroy = asn1_bio_free,
136 asn1_bio_callback_ctrl, 136 .callback_ctrl = asn1_bio_callback_ctrl
137}; 137};
138 138
139BIO_METHOD * 139BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/asn1/x_crl.c b/src/lib/libssl/src/crypto/asn1/x_crl.c
index 674cca4a1c..097a39c4d1 100644
--- a/src/lib/libssl/src/crypto/asn1/x_crl.c
+++ b/src/lib/libssl/src/crypto/asn1/x_crl.c
@@ -78,11 +78,8 @@ static int def_crl_lookup(X509_CRL *crl, X509_REVOKED **ret,
78 ASN1_INTEGER *serial, X509_NAME *issuer); 78 ASN1_INTEGER *serial, X509_NAME *issuer);
79 79
80static X509_CRL_METHOD int_crl_meth = { 80static X509_CRL_METHOD int_crl_meth = {
81 0, 81 .crl_lookup = def_crl_lookup,
82 0, 82 .crl_verify = def_crl_verify
83 0,
84 def_crl_lookup,
85 def_crl_verify
86}; 83};
87 84
88static const X509_CRL_METHOD *default_crl_method = &int_crl_meth; 85static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
diff --git a/src/lib/libssl/src/crypto/bio/bf_buff.c b/src/lib/libssl/src/crypto/bio/bf_buff.c
index 99be1a629e..e96da40a58 100644
--- a/src/lib/libssl/src/crypto/bio/bf_buff.c
+++ b/src/lib/libssl/src/crypto/bio/bf_buff.c
@@ -72,16 +72,16 @@ static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
72#define DEFAULT_BUFFER_SIZE 4096 72#define DEFAULT_BUFFER_SIZE 4096
73 73
74static BIO_METHOD methods_buffer = { 74static BIO_METHOD methods_buffer = {
75 BIO_TYPE_BUFFER, 75 .type = BIO_TYPE_BUFFER,
76 "buffer", 76 .name = "buffer",
77 buffer_write, 77 .bwrite = buffer_write,
78 buffer_read, 78 .bread = buffer_read,
79 buffer_puts, 79 .bputs = buffer_puts,
80 buffer_gets, 80 .bgets = buffer_gets,
81 buffer_ctrl, 81 .ctrl = buffer_ctrl,
82 buffer_new, 82 .create = buffer_new,
83 buffer_free, 83 .destroy = buffer_free,
84 buffer_callback_ctrl, 84 .callback_ctrl = buffer_callback_ctrl
85}; 85};
86 86
87BIO_METHOD * 87BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bf_lbuf.c b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
index f0bd0d709e..54c370d038 100644
--- a/src/lib/libssl/src/crypto/bio/bf_lbuf.c
+++ b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
@@ -77,16 +77,16 @@ static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
77/* #define DEBUG */ 77/* #define DEBUG */
78 78
79static BIO_METHOD methods_linebuffer = { 79static BIO_METHOD methods_linebuffer = {
80 BIO_TYPE_LINEBUFFER, 80 .type = BIO_TYPE_LINEBUFFER,
81 "linebuffer", 81 .name = "linebuffer",
82 linebuffer_write, 82 .bwrite = linebuffer_write,
83 linebuffer_read, 83 .bread = linebuffer_read,
84 linebuffer_puts, 84 .bputs = linebuffer_puts,
85 linebuffer_gets, 85 .bgets = linebuffer_gets,
86 linebuffer_ctrl, 86 .ctrl = linebuffer_ctrl,
87 linebuffer_new, 87 .create = linebuffer_new,
88 linebuffer_free, 88 .destroy = linebuffer_free,
89 linebuffer_callback_ctrl, 89 .callback_ctrl = linebuffer_callback_ctrl
90}; 90};
91 91
92BIO_METHOD * 92BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bf_nbio.c b/src/lib/libssl/src/crypto/bio/bf_nbio.c
index 048e6892cc..5a0f6b276a 100644
--- a/src/lib/libssl/src/crypto/bio/bf_nbio.c
+++ b/src/lib/libssl/src/crypto/bio/bf_nbio.c
@@ -81,16 +81,16 @@ typedef struct nbio_test_st {
81} NBIO_TEST; 81} NBIO_TEST;
82 82
83static BIO_METHOD methods_nbiof = { 83static BIO_METHOD methods_nbiof = {
84 BIO_TYPE_NBIO_TEST, 84 .type = BIO_TYPE_NBIO_TEST,
85 "non-blocking IO test filter", 85 .name = "non-blocking IO test filter",
86 nbiof_write, 86 .bwrite = nbiof_write,
87 nbiof_read, 87 .bread = nbiof_read,
88 nbiof_puts, 88 .bputs = nbiof_puts,
89 nbiof_gets, 89 .bgets = nbiof_gets,
90 nbiof_ctrl, 90 .ctrl = nbiof_ctrl,
91 nbiof_new, 91 .create = nbiof_new,
92 nbiof_free, 92 .destroy = nbiof_free,
93 nbiof_callback_ctrl, 93 .callback_ctrl = nbiof_callback_ctrl
94}; 94};
95 95
96BIO_METHOD * 96BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bf_null.c b/src/lib/libssl/src/crypto/bio/bf_null.c
index 3bba2afe98..7554ed9cf5 100644
--- a/src/lib/libssl/src/crypto/bio/bf_null.c
+++ b/src/lib/libssl/src/crypto/bio/bf_null.c
@@ -74,16 +74,16 @@ static int nullf_free(BIO *data);
74static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); 74static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
75 75
76static BIO_METHOD methods_nullf = { 76static BIO_METHOD methods_nullf = {
77 BIO_TYPE_NULL_FILTER, 77 .type = BIO_TYPE_NULL_FILTER,
78 "NULL filter", 78 .name = "NULL filter",
79 nullf_write, 79 .bwrite = nullf_write,
80 nullf_read, 80 .bread = nullf_read,
81 nullf_puts, 81 .bputs = nullf_puts,
82 nullf_gets, 82 .bgets = nullf_gets,
83 nullf_ctrl, 83 .ctrl = nullf_ctrl,
84 nullf_new, 84 .create = nullf_new,
85 nullf_free, 85 .destroy = nullf_free,
86 nullf_callback_ctrl, 86 .callback_ctrl = nullf_callback_ctrl
87}; 87};
88 88
89BIO_METHOD * 89BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_acpt.c b/src/lib/libssl/src/crypto/bio/bss_acpt.c
index 916af3cb20..943d3d9d96 100644
--- a/src/lib/libssl/src/crypto/bio/bss_acpt.c
+++ b/src/lib/libssl/src/crypto/bio/bss_acpt.c
@@ -98,16 +98,14 @@ static void BIO_ACCEPT_free(BIO_ACCEPT *a);
98#define ACPT_S_OK 3 98#define ACPT_S_OK 3
99 99
100static BIO_METHOD methods_acceptp = { 100static BIO_METHOD methods_acceptp = {
101 BIO_TYPE_ACCEPT, 101 .type = BIO_TYPE_ACCEPT,
102 "socket accept", 102 .name = "socket accept",
103 acpt_write, 103 .bwrite = acpt_write,
104 acpt_read, 104 .bread = acpt_read,
105 acpt_puts, 105 .bputs = acpt_puts,
106 NULL, /* connect_gets, */ 106 .ctrl = acpt_ctrl,
107 acpt_ctrl, 107 .create = acpt_new,
108 acpt_new, 108 .destroy = acpt_free
109 acpt_free,
110 NULL,
111}; 109};
112 110
113BIO_METHOD * 111BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_bio.c b/src/lib/libssl/src/crypto/bio/bss_bio.c
index d31e59872e..1a17cdf275 100644
--- a/src/lib/libssl/src/crypto/bio/bss_bio.c
+++ b/src/lib/libssl/src/crypto/bio/bss_bio.c
@@ -94,16 +94,14 @@ static int bio_make_pair(BIO *bio1, BIO *bio2);
94static void bio_destroy_pair(BIO *bio); 94static void bio_destroy_pair(BIO *bio);
95 95
96static BIO_METHOD methods_biop = { 96static BIO_METHOD methods_biop = {
97 BIO_TYPE_BIO, 97 .type = BIO_TYPE_BIO,
98 "BIO pair", 98 .name = "BIO pair",
99 bio_write, 99 .bwrite = bio_write,
100 bio_read, 100 .bread = bio_read,
101 bio_puts, 101 .bputs = bio_puts,
102 NULL /* no bio_gets */, 102 .ctrl = bio_ctrl,
103 bio_ctrl, 103 .create = bio_new,
104 bio_new, 104 .destroy = bio_free
105 bio_free,
106 NULL /* no bio_callback_ctrl */
107}; 105};
108 106
109BIO_METHOD * 107BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_conn.c b/src/lib/libssl/src/crypto/bio/bss_conn.c
index d7a8619b38..7ed8f1fe31 100644
--- a/src/lib/libssl/src/crypto/bio/bss_conn.c
+++ b/src/lib/libssl/src/crypto/bio/bss_conn.c
@@ -103,16 +103,15 @@ BIO_CONNECT *BIO_CONNECT_new(void);
103void BIO_CONNECT_free(BIO_CONNECT *a); 103void BIO_CONNECT_free(BIO_CONNECT *a);
104 104
105static BIO_METHOD methods_connectp = { 105static BIO_METHOD methods_connectp = {
106 BIO_TYPE_CONNECT, 106 .type = BIO_TYPE_CONNECT,
107 "socket connect", 107 .name = "socket connect",
108 conn_write, 108 .bwrite = conn_write,
109 conn_read, 109 .bread = conn_read,
110 conn_puts, 110 .bputs = conn_puts,
111 NULL, /* connect_gets, */ 111 .ctrl = conn_ctrl,
112 conn_ctrl, 112 .create = conn_new,
113 conn_new, 113 .destroy = conn_free,
114 conn_free, 114 .callback_ctrl = conn_callback_ctrl
115 conn_callback_ctrl,
116}; 115};
117 116
118static int 117static int
diff --git a/src/lib/libssl/src/crypto/bio/bss_dgram.c b/src/lib/libssl/src/crypto/bio/bss_dgram.c
index 8c08eff352..8f7439c51e 100644
--- a/src/lib/libssl/src/crypto/bio/bss_dgram.c
+++ b/src/lib/libssl/src/crypto/bio/bss_dgram.c
@@ -106,30 +106,26 @@ static int BIO_dgram_should_retry(int s);
106static void get_current_time(struct timeval *t); 106static void get_current_time(struct timeval *t);
107 107
108static BIO_METHOD methods_dgramp = { 108static BIO_METHOD methods_dgramp = {
109 BIO_TYPE_DGRAM, 109 .type = BIO_TYPE_DGRAM,
110 "datagram socket", 110 .name = "datagram socket",
111 dgram_write, 111 .bwrite = dgram_write,
112 dgram_read, 112 .bread = dgram_read,
113 dgram_puts, 113 .bputs = dgram_puts,
114 NULL, /* dgram_gets, */ 114 .ctrl = dgram_ctrl,
115 dgram_ctrl, 115 .create = dgram_new,
116 dgram_new, 116 .destroy = dgram_free
117 dgram_free,
118 NULL,
119}; 117};
120 118
121#ifndef OPENSSL_NO_SCTP 119#ifndef OPENSSL_NO_SCTP
122static BIO_METHOD methods_dgramp_sctp = { 120static BIO_METHOD methods_dgramp_sctp = {
123 BIO_TYPE_DGRAM_SCTP, 121 .type = BIO_TYPE_DGRAM_SCTP,
124 "datagram sctp socket", 122 .name = "datagram sctp socket",
125 dgram_sctp_write, 123 .bwrite = dgram_sctp_write,
126 dgram_sctp_read, 124 .bread = dgram_sctp_read,
127 dgram_sctp_puts, 125 .bputs = dgram_sctp_puts,
128 NULL, /* dgram_gets, */ 126 .ctrl = dgram_sctp_ctrl,
129 dgram_sctp_ctrl, 127 .create = dgram_sctp_new,
130 dgram_sctp_new, 128 .destroy = dgram_sctp_free
131 dgram_sctp_free,
132 NULL,
133}; 129};
134#endif 130#endif
135 131
diff --git a/src/lib/libssl/src/crypto/bio/bss_fd.c b/src/lib/libssl/src/crypto/bio/bss_fd.c
index 8ea80f1f65..04a88a155b 100644
--- a/src/lib/libssl/src/crypto/bio/bss_fd.c
+++ b/src/lib/libssl/src/crypto/bio/bss_fd.c
@@ -79,15 +79,15 @@ static int fd_free(BIO *data);
79int BIO_fd_should_retry(int s); 79int BIO_fd_should_retry(int s);
80 80
81static BIO_METHOD methods_fdp = { 81static BIO_METHOD methods_fdp = {
82 BIO_TYPE_FD, "file descriptor", 82 .type = BIO_TYPE_FD,
83 fd_write, 83 .name = "file descriptor",
84 fd_read, 84 .bwrite = fd_write,
85 fd_puts, 85 .bread = fd_read,
86 fd_gets, 86 .bputs = fd_puts,
87 fd_ctrl, 87 .bgets = fd_gets,
88 fd_new, 88 .ctrl = fd_ctrl,
89 fd_free, 89 .create = fd_new,
90 NULL, 90 .destroy = fd_free
91}; 91};
92 92
93BIO_METHOD * 93BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_file.c b/src/lib/libssl/src/crypto/bio/bss_file.c
index 6d5444f666..6f81a45a47 100644
--- a/src/lib/libssl/src/crypto/bio/bss_file.c
+++ b/src/lib/libssl/src/crypto/bio/bss_file.c
@@ -100,16 +100,15 @@ static int file_new(BIO *h);
100static int file_free(BIO *data); 100static int file_free(BIO *data);
101 101
102static BIO_METHOD methods_filep = { 102static BIO_METHOD methods_filep = {
103 BIO_TYPE_FILE, 103 .type = BIO_TYPE_FILE,
104 "FILE pointer", 104 .name = "FILE pointer",
105 file_write, 105 .bwrite = file_write,
106 file_read, 106 .bread = file_read,
107 file_puts, 107 .bputs = file_puts,
108 file_gets, 108 .bgets = file_gets,
109 file_ctrl, 109 .ctrl = file_ctrl,
110 file_new, 110 .create = file_new,
111 file_free, 111 .destroy = file_free
112 NULL,
113}; 112};
114 113
115BIO * 114BIO *
diff --git a/src/lib/libssl/src/crypto/bio/bss_log.c b/src/lib/libssl/src/crypto/bio/bss_log.c
index 6aa2d8b0a4..ac1cbc5087 100644
--- a/src/lib/libssl/src/crypto/bio/bss_log.c
+++ b/src/lib/libssl/src/crypto/bio/bss_log.c
@@ -86,15 +86,13 @@ static void xsyslog(BIO* bp, int priority, const char* string);
86static void xcloselog(BIO* bp); 86static void xcloselog(BIO* bp);
87 87
88static BIO_METHOD methods_slg = { 88static BIO_METHOD methods_slg = {
89 BIO_TYPE_MEM, "syslog", 89 .type = BIO_TYPE_MEM,
90 slg_write, 90 .name = "syslog",
91 NULL, 91 .bwrite = slg_write,
92 slg_puts, 92 .bputs = slg_puts,
93 NULL, 93 .ctrl = slg_ctrl,
94 slg_ctrl, 94 .create = slg_new,
95 slg_new, 95 .destroy = slg_free
96 slg_free,
97 NULL,
98}; 96};
99 97
100BIO_METHOD * 98BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_mem.c b/src/lib/libssl/src/crypto/bio/bss_mem.c
index 1a477c12be..b147a8eccb 100644
--- a/src/lib/libssl/src/crypto/bio/bss_mem.c
+++ b/src/lib/libssl/src/crypto/bio/bss_mem.c
@@ -70,16 +70,15 @@ static int mem_new(BIO *h);
70static int mem_free(BIO *data); 70static int mem_free(BIO *data);
71 71
72static BIO_METHOD mem_method = { 72static BIO_METHOD mem_method = {
73 BIO_TYPE_MEM, 73 .type = BIO_TYPE_MEM,
74 "memory buffer", 74 .name = "memory buffer",
75 mem_write, 75 .bwrite = mem_write,
76 mem_read, 76 .bread = mem_read,
77 mem_puts, 77 .bputs = mem_puts,
78 mem_gets, 78 .bgets = mem_gets,
79 mem_ctrl, 79 .ctrl = mem_ctrl,
80 mem_new, 80 .create = mem_new,
81 mem_free, 81 .destroy = mem_free
82 NULL,
83}; 82};
84 83
85/* bio->num is used to hold the value to return on 'empty', if it is 84/* bio->num is used to hold the value to return on 'empty', if it is
diff --git a/src/lib/libssl/src/crypto/bio/bss_null.c b/src/lib/libssl/src/crypto/bio/bss_null.c
index c7289725d9..a5796ea87a 100644
--- a/src/lib/libssl/src/crypto/bio/bss_null.c
+++ b/src/lib/libssl/src/crypto/bio/bss_null.c
@@ -70,16 +70,15 @@ static int null_new(BIO *h);
70static int null_free(BIO *data); 70static int null_free(BIO *data);
71 71
72static BIO_METHOD null_method = { 72static BIO_METHOD null_method = {
73 BIO_TYPE_NULL, 73 .type = BIO_TYPE_NULL,
74 "NULL", 74 .name = "NULL",
75 null_write, 75 .bwrite = null_write,
76 null_read, 76 .bread = null_read,
77 null_puts, 77 .bputs = null_puts,
78 null_gets, 78 .bgets = null_gets,
79 null_ctrl, 79 .ctrl = null_ctrl,
80 null_new, 80 .create = null_new,
81 null_free, 81 .destroy = null_free
82 NULL,
83}; 82};
84 83
85BIO_METHOD * 84BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/bio/bss_sock.c b/src/lib/libssl/src/crypto/bio/bss_sock.c
index 3dae2562bf..757e1dbb8f 100644
--- a/src/lib/libssl/src/crypto/bio/bss_sock.c
+++ b/src/lib/libssl/src/crypto/bio/bss_sock.c
@@ -74,16 +74,14 @@ static int sock_free(BIO *data);
74int BIO_sock_should_retry(int s); 74int BIO_sock_should_retry(int s);
75 75
76static BIO_METHOD methods_sockp = { 76static BIO_METHOD methods_sockp = {
77 BIO_TYPE_SOCKET, 77 .type = BIO_TYPE_SOCKET,
78 "socket", 78 .name = "socket",
79 sock_write, 79 .bwrite = sock_write,
80 sock_read, 80 .bread = sock_read,
81 sock_puts, 81 .bputs = sock_puts,
82 NULL, /* sock_gets, */ 82 .ctrl = sock_ctrl,
83 sock_ctrl, 83 .create = sock_new,
84 sock_new, 84 .destroy = sock_free
85 sock_free,
86 NULL,
87}; 85};
88 86
89BIO_METHOD * 87BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/cmac/cm_ameth.c b/src/lib/libssl/src/crypto/cmac/cm_ameth.c
index 0b8e5670b0..c960e1cf43 100644
--- a/src/lib/libssl/src/crypto/cmac/cm_ameth.c
+++ b/src/lib/libssl/src/crypto/cmac/cm_ameth.c
@@ -73,25 +73,14 @@ static void cmac_key_free(EVP_PKEY *pkey)
73 CMAC_CTX_free(cmctx); 73 CMAC_CTX_free(cmctx);
74 } 74 }
75 75
76const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = 76const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = {
77 { 77 .pkey_id = EVP_PKEY_CMAC,
78 EVP_PKEY_CMAC, 78 .pkey_base_id = EVP_PKEY_CMAC,
79 EVP_PKEY_CMAC,
80 0,
81
82 "CMAC",
83 "OpenSSL CMAC method",
84
85 0,0,0,0,
86
87 0,0,0,
88 79
89 cmac_size, 80 .pem_str = "CMAC",
90 0, 81 .info = "OpenSSL CMAC method",
91 0,0,0,0,0,0,0,
92 82
93 cmac_key_free, 83 .pkey_size = cmac_size,
94 0, 84 .pkey_free = cmac_key_free
95 0,0 85};
96 };
97 86
diff --git a/src/lib/libssl/src/crypto/cmac/cm_pmeth.c b/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
index 00aa4d64d2..e1a00e90bb 100644
--- a/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
+++ b/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
@@ -188,37 +188,19 @@ static int pkey_cmac_ctrl_str(EVP_PKEY_CTX *ctx,
188 return -2; 188 return -2;
189 } 189 }
190 190
191const EVP_PKEY_METHOD cmac_pkey_meth = 191const EVP_PKEY_METHOD cmac_pkey_meth = {
192 { 192 .pkey_id = EVP_PKEY_CMAC,
193 EVP_PKEY_CMAC, 193 .flags = EVP_PKEY_FLAG_SIGCTX_CUSTOM,
194 EVP_PKEY_FLAG_SIGCTX_CUSTOM,
195 pkey_cmac_init,
196 pkey_cmac_copy,
197 pkey_cmac_cleanup,
198
199 0, 0,
200
201 0,
202 pkey_cmac_keygen,
203
204 0, 0,
205
206 0, 0,
207
208 0,0,
209
210 cmac_signctx_init,
211 cmac_signctx,
212
213 0,0,
214
215 0,0,
216 194
217 0,0, 195 .init = pkey_cmac_init,
196 .copy = pkey_cmac_copy,
197 .cleanup = pkey_cmac_cleanup,
218 198
219 0,0, 199 .keygen = pkey_cmac_keygen,
220 200
221 pkey_cmac_ctrl, 201 .signctx_init = cmac_signctx_init,
222 pkey_cmac_ctrl_str 202 .signctx = cmac_signctx,
223 203
224 }; 204 .ctrl = pkey_cmac_ctrl,
205 .ctrl_str = pkey_cmac_ctrl_str
206};
diff --git a/src/lib/libssl/src/crypto/comp/c_rle.c b/src/lib/libssl/src/crypto/comp/c_rle.c
index 7a5db298c5..48e48cbb7a 100644
--- a/src/lib/libssl/src/crypto/comp/c_rle.c
+++ b/src/lib/libssl/src/crypto/comp/c_rle.c
@@ -10,14 +10,10 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
10 unsigned int olen, unsigned char *in, unsigned int ilen); 10 unsigned int olen, unsigned char *in, unsigned int ilen);
11 11
12static COMP_METHOD rle_method = { 12static COMP_METHOD rle_method = {
13 NID_rle_compression, 13 .type = NID_rle_compression,
14 LN_rle_compression, 14 .name = LN_rle_compression,
15 NULL, 15 .compress = rle_compress_block,
16 NULL, 16 .expand = rle_expand_block
17 rle_compress_block,
18 rle_expand_block,
19 NULL,
20 NULL,
21}; 17};
22 18
23COMP_METHOD * 19COMP_METHOD *
diff --git a/src/lib/libssl/src/crypto/comp/c_zlib.c b/src/lib/libssl/src/crypto/comp/c_zlib.c
index 3a73b3df0b..26c6507cd5 100644
--- a/src/lib/libssl/src/crypto/comp/c_zlib.c
+++ b/src/lib/libssl/src/crypto/comp/c_zlib.c
@@ -8,14 +8,8 @@
8COMP_METHOD *COMP_zlib(void ); 8COMP_METHOD *COMP_zlib(void );
9 9
10static COMP_METHOD zlib_method_nozlib = { 10static COMP_METHOD zlib_method_nozlib = {
11 NID_undef, 11 .type = NID_undef,
12 "(undef)", 12 .name = "(undef)"
13 NULL,
14 NULL,
15 NULL,
16 NULL,
17 NULL,
18 NULL,
19}; 13};
20 14
21#ifndef ZLIB 15#ifndef ZLIB
@@ -55,26 +49,20 @@ static int zz_uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
55 uLong sourceLen); 49 uLong sourceLen);
56 50
57static COMP_METHOD zlib_stateless_method = { 51static COMP_METHOD zlib_stateless_method = {
58 NID_zlib_compression, 52 .type = NID_zlib_compression,
59 LN_zlib_compression, 53 .name = LN_zlib_compression,
60 NULL, 54 .compress = zlib_compress_block,
61 NULL, 55 .expand = zlib_expand_block
62 zlib_compress_block,
63 zlib_expand_block,
64 NULL,
65 NULL,
66}; 56};
67#endif 57#endif
68 58
69static COMP_METHOD zlib_stateful_method = { 59static COMP_METHOD zlib_stateful_method = {
70 NID_zlib_compression, 60 .type = NID_zlib_compression,
71 LN_zlib_compression, 61 .name = LN_zlib_compression,
72 zlib_stateful_init, 62 .init = zlib_stateful_init,
73 zlib_stateful_finish, 63 .finish = zlib_stateful_finish,
74 zlib_stateful_compress_block, 64 .compress = zlib_stateful_compress_block,
75 zlib_stateful_expand_block, 65 .expand = zlib_stateful_expand_block
76 NULL,
77 NULL,
78}; 66};
79 67
80#ifdef ZLIB_SHARED 68#ifdef ZLIB_SHARED
@@ -433,16 +421,14 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr);
433static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp); 421static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
434 422
435static BIO_METHOD bio_meth_zlib = { 423static BIO_METHOD bio_meth_zlib = {
436 BIO_TYPE_COMP, 424 .type = BIO_TYPE_COMP,
437 "zlib", 425 .name = "zlib",
438 bio_zlib_write, 426 .bwrite = bio_zlib_write,
439 bio_zlib_read, 427 .bread = bio_zlib_read,
440 NULL, 428 .ctrl = bio_zlib_ctrl,
441 NULL, 429 .create = bio_zlib_new,
442 bio_zlib_ctrl, 430 .destroy = bio_zlib_free,
443 bio_zlib_new, 431 .callback_ctrl = bio_zlib_callback_ctrl
444 bio_zlib_free,
445 bio_zlib_callback_ctrl
446}; 432};
447 433
448BIO_METHOD * 434BIO_METHOD *
diff --git a/src/lib/libssl/src/crypto/conf/conf_def.c b/src/lib/libssl/src/crypto/conf/conf_def.c
index d85773df0e..b3c75e1a9e 100644
--- a/src/lib/libssl/src/crypto/conf/conf_def.c
+++ b/src/lib/libssl/src/crypto/conf/conf_def.c
@@ -91,16 +91,16 @@ static int def_to_int(const CONF *conf, char c);
91const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT; 91const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
92 92
93static CONF_METHOD default_method = { 93static CONF_METHOD default_method = {
94 "OpenSSL default", 94 .name = "OpenSSL default",
95 def_create, 95 .create = def_create,
96 def_init_default, 96 .init = def_init_default,
97 def_destroy, 97 .destroy = def_destroy,
98 def_destroy_data, 98 .destroy_data = def_destroy_data,
99 def_load_bio, 99 .load_bio = def_load_bio,
100 def_dump, 100 .dump = def_dump,
101 def_is_number, 101 .is_number = def_is_number,
102 def_to_int, 102 .to_int = def_to_int,
103 def_load 103 .load = def_load
104}; 104};
105 105
106static CONF_METHOD WIN32_method = { 106static CONF_METHOD WIN32_method = {
diff --git a/src/lib/libssl/src/crypto/dh/dh_ameth.c b/src/lib/libssl/src/crypto/dh/dh_ameth.c
index d39f4b373d..a22614ae0a 100644
--- a/src/lib/libssl/src/crypto/dh/dh_ameth.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/dh/dh_key.c b/src/lib/libssl/src/crypto/dh/dh_key.c
index 9596270f7d..91352a9fbf 100644
--- a/src/lib/libssl/src/crypto/dh/dh_key.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/dh/dh_pmeth.c b/src/lib/libssl/src/crypto/dh/dh_pmeth.c
index ec4553c0a8..c359bb4d2b 100644
--- a/src/lib/libssl/src/crypto/dh/dh_pmeth.c
+++ b/src/lib/libssl/src/crypto/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};
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
index e9c549802d..ebca5ec5c5 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
@@ -640,65 +640,61 @@ static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
640 640
641/* NB these are sorted in pkey_id order, lowest first */ 641/* NB these are sorted in pkey_id order, lowest first */
642 642
643const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = 643const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = {
644 { 644 {
645 .pkey_id = EVP_PKEY_DSA2,
646 .pkey_base_id = EVP_PKEY_DSA,
647 .pkey_flags = ASN1_PKEY_ALIAS
648 },
645 649
646 { 650 {
647 EVP_PKEY_DSA2, 651 .pkey_id = EVP_PKEY_DSA1,
648 EVP_PKEY_DSA, 652 .pkey_base_id = EVP_PKEY_DSA,
649 ASN1_PKEY_ALIAS 653 .pkey_flags = ASN1_PKEY_ALIAS
650 }, 654 },
651
652 {
653 EVP_PKEY_DSA1,
654 EVP_PKEY_DSA,
655 ASN1_PKEY_ALIAS
656 },
657
658 {
659 EVP_PKEY_DSA4,
660 EVP_PKEY_DSA,
661 ASN1_PKEY_ALIAS
662 },
663 655
664 { 656 {
665 EVP_PKEY_DSA3, 657 .pkey_id = EVP_PKEY_DSA4,
666 EVP_PKEY_DSA, 658 .pkey_base_id = EVP_PKEY_DSA,
667 ASN1_PKEY_ALIAS 659 .pkey_flags = ASN1_PKEY_ALIAS
668 }, 660 },
669 661
670 { 662 {
671 EVP_PKEY_DSA, 663 .pkey_id = EVP_PKEY_DSA3,
672 EVP_PKEY_DSA, 664 .pkey_base_id = EVP_PKEY_DSA,
673 0, 665 .pkey_flags = ASN1_PKEY_ALIAS
674 666 },
675 "DSA",
676 "OpenSSL DSA method",
677
678 dsa_pub_decode,
679 dsa_pub_encode,
680 dsa_pub_cmp,
681 dsa_pub_print,
682
683 dsa_priv_decode,
684 dsa_priv_encode,
685 dsa_priv_print,
686
687 int_dsa_size,
688 dsa_bits,
689
690 dsa_param_decode,
691 dsa_param_encode,
692 dsa_missing_parameters,
693 dsa_copy_parameters,
694 dsa_cmp_parameters,
695 dsa_param_print,
696 dsa_sig_print,
697
698 int_dsa_free,
699 dsa_pkey_ctrl,
700 old_dsa_priv_decode,
701 old_dsa_priv_encode
702 }
703 };
704 667
668 {
669 .pkey_id = EVP_PKEY_DSA,
670 .pkey_base_id = EVP_PKEY_DSA,
671
672 .pem_str = "DSA",
673 .info = "OpenSSL DSA method",
674
675 .pub_decode = dsa_pub_decode,
676 .pub_encode = dsa_pub_encode,
677 .pub_cmp = dsa_pub_cmp,
678 .pub_print = dsa_pub_print,
679
680 .priv_decode = dsa_priv_decode,
681 .priv_encode = dsa_priv_encode,
682 .priv_print = dsa_priv_print,
683
684 .pkey_size = int_dsa_size,
685 .pkey_bits = dsa_bits,
686
687 .param_decode = dsa_param_decode,
688 .param_encode = dsa_param_encode,
689 .param_missing = dsa_missing_parameters,
690 .param_copy = dsa_copy_parameters,
691 .param_cmp = dsa_cmp_parameters,
692 .param_print = dsa_param_print,
693 .sig_print = dsa_sig_print,
694
695 .pkey_free = int_dsa_free,
696 .pkey_ctrl = dsa_pkey_ctrl,
697 .old_priv_decode = old_dsa_priv_decode,
698 .old_priv_encode = old_dsa_priv_encode
699 }
700};
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
index b3d78e524c..7e0e3b006e 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
@@ -74,18 +74,12 @@ static int dsa_init(DSA *dsa);
74static int dsa_finish(DSA *dsa); 74static int dsa_finish(DSA *dsa);
75 75
76static DSA_METHOD openssl_dsa_meth = { 76static DSA_METHOD openssl_dsa_meth = {
77"OpenSSL DSA method", 77 .name = "OpenSSL DSA method",
78dsa_do_sign, 78 .dsa_do_sign = dsa_do_sign,
79dsa_sign_setup, 79 .dsa_sign_setup = dsa_sign_setup,
80dsa_do_verify, 80 .dsa_do_verify = dsa_do_verify,
81NULL, /* dsa_mod_exp, */ 81 .init = dsa_init,
82NULL, /* dsa_bn_mod_exp, */ 82 .finish = dsa_finish
83dsa_init,
84dsa_finish,
850,
86NULL,
87NULL,
88NULL
89}; 83};
90 84
91/* These macro wrappers replace attempts to use the dsa_mod_exp() and 85/* These macro wrappers replace attempts to use the dsa_mod_exp() and
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c b/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
index 7076bf7b67..4e77c6f64b 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
@@ -281,38 +281,22 @@ static int pkey_dsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
281 return DSA_generate_key(pkey->pkey.dsa); 281 return DSA_generate_key(pkey->pkey.dsa);
282 } 282 }
283 283
284const EVP_PKEY_METHOD dsa_pkey_meth = 284const EVP_PKEY_METHOD dsa_pkey_meth = {
285 { 285 .pkey_id = EVP_PKEY_DSA,
286 EVP_PKEY_DSA, 286 .flags = EVP_PKEY_FLAG_AUTOARGLEN,
287 EVP_PKEY_FLAG_AUTOARGLEN,
288 pkey_dsa_init,
289 pkey_dsa_copy,
290 pkey_dsa_cleanup,
291
292 0,
293 pkey_dsa_paramgen,
294
295 0,
296 pkey_dsa_keygen,
297
298 0,
299 pkey_dsa_sign,
300
301 0,
302 pkey_dsa_verify,
303
304 0,0,
305
306 0,0,0,0,
307 287
308 0,0, 288 .init = pkey_dsa_init,
289 .copy = pkey_dsa_copy,
290 .cleanup = pkey_dsa_cleanup,
309 291
310 0,0, 292 .paramgen = pkey_dsa_paramgen,
311 293
312 0,0, 294 .keygen = pkey_dsa_keygen,
313 295
314 pkey_dsa_ctrl, 296 .sign = pkey_dsa_sign,
315 pkey_dsa_ctrl_str
316 297
298 .verify = pkey_dsa_verify,
317 299
318 }; 300 .ctrl = pkey_dsa_ctrl,
301 .ctrl_str = pkey_dsa_ctrl_str
302};
diff --git a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
index 6cf9ab2667..bebfdcdbc4 100644
--- a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
+++ b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
@@ -93,23 +93,15 @@ static int dlfcn_pathbyaddr(void *addr, char *path, int sz);
93static void *dlfcn_globallookup(const char *name); 93static void *dlfcn_globallookup(const char *name);
94 94
95static DSO_METHOD dso_meth_dlfcn = { 95static DSO_METHOD dso_meth_dlfcn = {
96 "OpenSSL 'dlfcn' shared library method", 96 .name = "OpenSSL 'dlfcn' shared library method",
97 dlfcn_load, 97 .dso_load = dlfcn_load,
98 dlfcn_unload, 98 .dso_unload = dlfcn_unload,
99 dlfcn_bind_var, 99 .dso_bind_var = dlfcn_bind_var,
100 dlfcn_bind_func, 100 .dso_bind_func = dlfcn_bind_func,
101/* For now, "unbind" doesn't exist */ 101 .dso_name_converter = dlfcn_name_converter,
102#if 0 102 .dso_merger = dlfcn_merger,
103 NULL, /* unbind_var */ 103 .pathbyaddr = dlfcn_pathbyaddr,
104 NULL, /* unbind_func */ 104 .globallookup = dlfcn_globallookup
105#endif
106 NULL, /* ctrl */
107 dlfcn_name_converter,
108 dlfcn_merger,
109 NULL, /* init */
110 NULL, /* finish */
111 dlfcn_pathbyaddr,
112 dlfcn_globallookup
113}; 105};
114 106
115DSO_METHOD * 107DSO_METHOD *
diff --git a/src/lib/libssl/src/crypto/dso/dso_null.c b/src/lib/libssl/src/crypto/dso/dso_null.c
index 0c877ab2f2..c9f4226cb5 100644
--- a/src/lib/libssl/src/crypto/dso/dso_null.c
+++ b/src/lib/libssl/src/crypto/dso/dso_null.c
@@ -64,23 +64,7 @@
64#include <openssl/dso.h> 64#include <openssl/dso.h>
65 65
66static DSO_METHOD dso_meth_null = { 66static DSO_METHOD dso_meth_null = {
67 "NULL shared library method", 67 .name = "NULL shared library method"
68 NULL, /* load */
69 NULL, /* unload */
70 NULL, /* bind_var */
71 NULL, /* bind_func */
72/* For now, "unbind" doesn't exist */
73#if 0
74 NULL, /* unbind_var */
75 NULL, /* unbind_func */
76#endif
77 NULL, /* ctrl */
78 NULL, /* dso_name_converter */
79 NULL, /* dso_merger */
80 NULL, /* init */
81 NULL, /* finish */
82 NULL, /* pathbyaddr */
83 NULL /* globallookup */
84}; 68};
85 69
86DSO_METHOD * 70DSO_METHOD *
diff --git a/src/lib/libssl/src/crypto/ec/ec2_smpl.c b/src/lib/libssl/src/crypto/ec/ec2_smpl.c
index 0cf681fa9d..5682bfab37 100644
--- a/src/lib/libssl/src/crypto/ec/ec2_smpl.c
+++ b/src/lib/libssl/src/crypto/ec/ec2_smpl.c
@@ -73,52 +73,51 @@
73 73
74#ifndef OPENSSL_NO_EC2M 74#ifndef OPENSSL_NO_EC2M
75 75
76const EC_METHOD *EC_GF2m_simple_method(void) 76const EC_METHOD *
77 { 77EC_GF2m_simple_method(void)
78{
78 static const EC_METHOD ret = { 79 static const EC_METHOD ret = {
79 EC_FLAGS_DEFAULT_OCT, 80 .flags = EC_FLAGS_DEFAULT_OCT,
80 NID_X9_62_characteristic_two_field, 81 .field_type = NID_X9_62_characteristic_two_field,
81 ec_GF2m_simple_group_init, 82 .group_init = ec_GF2m_simple_group_init,
82 ec_GF2m_simple_group_finish, 83 .group_finish = ec_GF2m_simple_group_finish,
83 ec_GF2m_simple_group_clear_finish, 84 .group_clear_finish = ec_GF2m_simple_group_clear_finish,
84 ec_GF2m_simple_group_copy, 85 .group_copy = ec_GF2m_simple_group_copy,
85 ec_GF2m_simple_group_set_curve, 86 .group_set_curve = ec_GF2m_simple_group_set_curve,
86 ec_GF2m_simple_group_get_curve, 87 .group_get_curve = ec_GF2m_simple_group_get_curve,
87 ec_GF2m_simple_group_get_degree, 88 .group_get_degree = ec_GF2m_simple_group_get_degree,
88 ec_GF2m_simple_group_check_discriminant, 89 .group_check_discriminant =
89 ec_GF2m_simple_point_init, 90 ec_GF2m_simple_group_check_discriminant,
90 ec_GF2m_simple_point_finish, 91 .point_init = ec_GF2m_simple_point_init,
91 ec_GF2m_simple_point_clear_finish, 92 .point_finish = ec_GF2m_simple_point_finish,
92 ec_GF2m_simple_point_copy, 93 .point_clear_finish = ec_GF2m_simple_point_clear_finish,
93 ec_GF2m_simple_point_set_to_infinity, 94 .point_copy = ec_GF2m_simple_point_copy,
94 0 /* set_Jprojective_coordinates_GFp */, 95 .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity,
95 0 /* get_Jprojective_coordinates_GFp */, 96 .point_set_affine_coordinates =
96 ec_GF2m_simple_point_set_affine_coordinates, 97 ec_GF2m_simple_point_set_affine_coordinates,
97 ec_GF2m_simple_point_get_affine_coordinates, 98 .point_get_affine_coordinates =
98 0,0,0, 99 ec_GF2m_simple_point_get_affine_coordinates,
99 ec_GF2m_simple_add, 100 .add = ec_GF2m_simple_add,
100 ec_GF2m_simple_dbl, 101 .dbl = ec_GF2m_simple_dbl,
101 ec_GF2m_simple_invert, 102 .invert = ec_GF2m_simple_invert,
102 ec_GF2m_simple_is_at_infinity, 103 .is_at_infinity = ec_GF2m_simple_is_at_infinity,
103 ec_GF2m_simple_is_on_curve, 104 .is_on_curve = ec_GF2m_simple_is_on_curve,
104 ec_GF2m_simple_cmp, 105 .point_cmp = ec_GF2m_simple_cmp,
105 ec_GF2m_simple_make_affine, 106 .make_affine = ec_GF2m_simple_make_affine,
106 ec_GF2m_simple_points_make_affine, 107 .points_make_affine = ec_GF2m_simple_points_make_affine,
107 108
108 /* the following three method functions are defined in ec2_mult.c */ 109 /* the following three method functions are defined in ec2_mult.c */
109 ec_GF2m_simple_mul, 110 .mul = ec_GF2m_simple_mul,
110 ec_GF2m_precompute_mult, 111 .precompute_mult = ec_GF2m_precompute_mult,
111 ec_GF2m_have_precompute_mult, 112 .have_precompute_mult = ec_GF2m_have_precompute_mult,
112 113
113 ec_GF2m_simple_field_mul, 114 .field_mul = ec_GF2m_simple_field_mul,
114 ec_GF2m_simple_field_sqr, 115 .field_sqr = ec_GF2m_simple_field_sqr,
115 ec_GF2m_simple_field_div, 116 .field_div = ec_GF2m_simple_field_div,
116 0 /* field_encode */, 117 };
117 0 /* field_decode */,
118 0 /* field_set_to_one */ };
119 118
120 return &ret; 119 return &ret;
121 } 120}
122 121
123 122
124/* Initialize a GF(2^m)-based EC_GROUP structure. 123/* Initialize a GF(2^m)-based EC_GROUP structure.
diff --git a/src/lib/libssl/src/crypto/ec/ec_ameth.c b/src/lib/libssl/src/crypto/ec/ec_ameth.c
index 79dd11083e..0e6381f543 100644
--- a/src/lib/libssl/src/crypto/ec/ec_ameth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_ameth.c
@@ -626,36 +626,34 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
626 626
627 } 627 }
628 628
629const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = 629const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
630 { 630 .pkey_id = EVP_PKEY_EC,
631 EVP_PKEY_EC, 631 .pkey_base_id = EVP_PKEY_EC,
632 EVP_PKEY_EC, 632
633 0, 633 .pem_str = "EC",
634 "EC", 634 .info = "OpenSSL EC algorithm",
635 "OpenSSL EC algorithm", 635
636 636 .pub_decode = eckey_pub_decode,
637 eckey_pub_decode, 637 .pub_encode = eckey_pub_encode,
638 eckey_pub_encode, 638 .pub_cmp = eckey_pub_cmp,
639 eckey_pub_cmp, 639 .pub_print = eckey_pub_print,
640 eckey_pub_print, 640
641 641 .priv_decode = eckey_priv_decode,
642 eckey_priv_decode, 642 .priv_encode = eckey_priv_encode,
643 eckey_priv_encode, 643 .priv_print = eckey_priv_print,
644 eckey_priv_print, 644
645 645 .pkey_size = int_ec_size,
646 int_ec_size, 646 .pkey_bits = ec_bits,
647 ec_bits, 647
648 648 .param_decode = eckey_param_decode,
649 eckey_param_decode, 649 .param_encode = eckey_param_encode,
650 eckey_param_encode, 650 .param_missing = ec_missing_parameters,
651 ec_missing_parameters, 651 .param_copy = ec_copy_parameters,
652 ec_copy_parameters, 652 .param_cmp = ec_cmp_parameters,
653 ec_cmp_parameters, 653 .param_print = eckey_param_print,
654 eckey_param_print, 654
655 0, 655 .pkey_free = int_ec_free,
656 656 .pkey_ctrl = ec_pkey_ctrl,
657 int_ec_free, 657 .old_priv_decode = old_ec_priv_decode,
658 ec_pkey_ctrl, 658 .old_priv_encode = old_ec_priv_encode
659 old_ec_priv_decode, 659};
660 old_ec_priv_encode
661 };
diff --git a/src/lib/libssl/src/crypto/ec/ec_pmeth.c b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
index dfc8ace27b..c970d8c9ca 100644
--- a/src/lib/libssl/src/crypto/ec/ec_pmeth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
@@ -304,38 +304,23 @@ static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
304 return EC_KEY_generate_key(pkey->pkey.ec); 304 return EC_KEY_generate_key(pkey->pkey.ec);
305 } 305 }
306 306
307const EVP_PKEY_METHOD ec_pkey_meth = 307const EVP_PKEY_METHOD ec_pkey_meth = {
308 { 308 .pkey_id = EVP_PKEY_EC,
309 EVP_PKEY_EC,
310 0,
311 pkey_ec_init,
312 pkey_ec_copy,
313 pkey_ec_cleanup,
314
315 0,
316 pkey_ec_paramgen,
317
318 0,
319 pkey_ec_keygen,
320
321 0,
322 pkey_ec_sign,
323
324 0,
325 pkey_ec_verify,
326 309
327 0,0, 310 .init = pkey_ec_init,
311 .copy = pkey_ec_copy,
312 .cleanup = pkey_ec_cleanup,
328 313
329 0,0,0,0, 314 .paramgen = pkey_ec_paramgen,
330 315
331 0,0, 316 .keygen = pkey_ec_keygen,
332 317
333 0,0, 318 .sign = pkey_ec_sign,
334 319
335 0, 320 .verify = pkey_ec_verify,
336 pkey_ec_derive,
337 321
338 pkey_ec_ctrl, 322 .derive = pkey_ec_derive,
339 pkey_ec_ctrl_str
340 323
341 }; 324 .ctrl = pkey_ec_ctrl,
325 .ctrl_str = pkey_ec_ctrl_str
326};
diff --git a/src/lib/libssl/src/crypto/ec/ecp_mont.c b/src/lib/libssl/src/crypto/ec/ecp_mont.c
index cee0fee12a..6b5b856344 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_mont.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_mont.c
@@ -66,49 +66,51 @@
66#include "ec_lcl.h" 66#include "ec_lcl.h"
67 67
68 68
69const EC_METHOD *EC_GFp_mont_method(void) 69const EC_METHOD *
70 { 70EC_GFp_mont_method(void)
71{
71 static const EC_METHOD ret = { 72 static const EC_METHOD ret = {
72 EC_FLAGS_DEFAULT_OCT, 73 .flags = EC_FLAGS_DEFAULT_OCT,
73 NID_X9_62_prime_field, 74 .field_type = NID_X9_62_prime_field,
74 ec_GFp_mont_group_init, 75 .group_init = ec_GFp_mont_group_init,
75 ec_GFp_mont_group_finish, 76 .group_finish = ec_GFp_mont_group_finish,
76 ec_GFp_mont_group_clear_finish, 77 .group_clear_finish = ec_GFp_mont_group_clear_finish,
77 ec_GFp_mont_group_copy, 78 .group_copy = ec_GFp_mont_group_copy,
78 ec_GFp_mont_group_set_curve, 79 .group_set_curve = ec_GFp_mont_group_set_curve,
79 ec_GFp_simple_group_get_curve, 80 .group_get_curve = ec_GFp_simple_group_get_curve,
80 ec_GFp_simple_group_get_degree, 81 .group_get_degree = ec_GFp_simple_group_get_degree,
81 ec_GFp_simple_group_check_discriminant, 82 .group_check_discriminant =
82 ec_GFp_simple_point_init, 83 ec_GFp_simple_group_check_discriminant,
83 ec_GFp_simple_point_finish, 84 .point_init = ec_GFp_simple_point_init,
84 ec_GFp_simple_point_clear_finish, 85 .point_finish = ec_GFp_simple_point_finish,
85 ec_GFp_simple_point_copy, 86 .point_clear_finish = ec_GFp_simple_point_clear_finish,
86 ec_GFp_simple_point_set_to_infinity, 87 .point_copy = ec_GFp_simple_point_copy,
87 ec_GFp_simple_set_Jprojective_coordinates_GFp, 88 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
88 ec_GFp_simple_get_Jprojective_coordinates_GFp, 89 .point_set_Jprojective_coordinates_GFp =
89 ec_GFp_simple_point_set_affine_coordinates, 90 ec_GFp_simple_set_Jprojective_coordinates_GFp,
90 ec_GFp_simple_point_get_affine_coordinates, 91 .point_get_Jprojective_coordinates_GFp =
91 0,0,0, 92 ec_GFp_simple_get_Jprojective_coordinates_GFp,
92 ec_GFp_simple_add, 93 .point_set_affine_coordinates =
93 ec_GFp_simple_dbl, 94 ec_GFp_simple_point_set_affine_coordinates,
94 ec_GFp_simple_invert, 95 .point_get_affine_coordinates =
95 ec_GFp_simple_is_at_infinity, 96 ec_GFp_simple_point_get_affine_coordinates,
96 ec_GFp_simple_is_on_curve, 97 .add = ec_GFp_simple_add,
97 ec_GFp_simple_cmp, 98 .dbl = ec_GFp_simple_dbl,
98 ec_GFp_simple_make_affine, 99 .invert = ec_GFp_simple_invert,
99 ec_GFp_simple_points_make_affine, 100 .is_at_infinity = ec_GFp_simple_is_at_infinity,
100 0 /* mul */, 101 .is_on_curve = ec_GFp_simple_is_on_curve,
101 0 /* precompute_mult */, 102 .point_cmp = ec_GFp_simple_cmp,
102 0 /* have_precompute_mult */, 103 .make_affine = ec_GFp_simple_make_affine,
103 ec_GFp_mont_field_mul, 104 .points_make_affine = ec_GFp_simple_points_make_affine,
104 ec_GFp_mont_field_sqr, 105 .field_mul = ec_GFp_mont_field_mul,
105 0 /* field_div */, 106 .field_sqr = ec_GFp_mont_field_sqr,
106 ec_GFp_mont_field_encode, 107 .field_encode = ec_GFp_mont_field_encode,
107 ec_GFp_mont_field_decode, 108 .field_decode = ec_GFp_mont_field_decode,
108 ec_GFp_mont_field_set_to_one }; 109 .field_set_to_one = ec_GFp_mont_field_set_to_one
110 };
109 111
110 return &ret; 112 return &ret;
111 } 113}
112 114
113 115
114int ec_GFp_mont_group_init(EC_GROUP *group) 116int ec_GFp_mont_group_init(EC_GROUP *group)
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nist.c b/src/lib/libssl/src/crypto/ec/ecp_nist.c
index ac5b814238..479cff8fc9 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_nist.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_nist.c
@@ -67,49 +67,48 @@
67#include <openssl/obj_mac.h> 67#include <openssl/obj_mac.h>
68#include "ec_lcl.h" 68#include "ec_lcl.h"
69 69
70const EC_METHOD *EC_GFp_nist_method(void) 70const EC_METHOD *
71 { 71EC_GFp_nist_method(void)
72{
72 static const EC_METHOD ret = { 73 static const EC_METHOD ret = {
73 EC_FLAGS_DEFAULT_OCT, 74 .flags = EC_FLAGS_DEFAULT_OCT,
74 NID_X9_62_prime_field, 75 .field_type = NID_X9_62_prime_field,
75 ec_GFp_simple_group_init, 76 .group_init = ec_GFp_simple_group_init,
76 ec_GFp_simple_group_finish, 77 .group_finish = ec_GFp_simple_group_finish,
77 ec_GFp_simple_group_clear_finish, 78 .group_clear_finish = ec_GFp_simple_group_clear_finish,
78 ec_GFp_nist_group_copy, 79 .group_copy = ec_GFp_nist_group_copy,
79 ec_GFp_nist_group_set_curve, 80 .group_set_curve = ec_GFp_nist_group_set_curve,
80 ec_GFp_simple_group_get_curve, 81 .group_get_curve = ec_GFp_simple_group_get_curve,
81 ec_GFp_simple_group_get_degree, 82 .group_get_degree = ec_GFp_simple_group_get_degree,
82 ec_GFp_simple_group_check_discriminant, 83 .group_check_discriminant =
83 ec_GFp_simple_point_init, 84 ec_GFp_simple_group_check_discriminant,
84 ec_GFp_simple_point_finish, 85 .point_init = ec_GFp_simple_point_init,
85 ec_GFp_simple_point_clear_finish, 86 .point_finish = ec_GFp_simple_point_finish,
86 ec_GFp_simple_point_copy, 87 .point_clear_finish = ec_GFp_simple_point_clear_finish,
87 ec_GFp_simple_point_set_to_infinity, 88 .point_copy = ec_GFp_simple_point_copy,
88 ec_GFp_simple_set_Jprojective_coordinates_GFp, 89 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
89 ec_GFp_simple_get_Jprojective_coordinates_GFp, 90 .point_set_Jprojective_coordinates_GFp =
90 ec_GFp_simple_point_set_affine_coordinates, 91 ec_GFp_simple_set_Jprojective_coordinates_GFp,
91 ec_GFp_simple_point_get_affine_coordinates, 92 .point_get_Jprojective_coordinates_GFp =
92 0,0,0, 93 ec_GFp_simple_get_Jprojective_coordinates_GFp,
93 ec_GFp_simple_add, 94 .point_set_affine_coordinates =
94 ec_GFp_simple_dbl, 95 ec_GFp_simple_point_set_affine_coordinates,
95 ec_GFp_simple_invert, 96 .point_get_affine_coordinates =
96 ec_GFp_simple_is_at_infinity, 97 ec_GFp_simple_point_get_affine_coordinates,
97 ec_GFp_simple_is_on_curve, 98 .add = ec_GFp_simple_add,
98 ec_GFp_simple_cmp, 99 .dbl = ec_GFp_simple_dbl,
99 ec_GFp_simple_make_affine, 100 .invert = ec_GFp_simple_invert,
100 ec_GFp_simple_points_make_affine, 101 .is_at_infinity = ec_GFp_simple_is_at_infinity,
101 0 /* mul */, 102 .is_on_curve = ec_GFp_simple_is_on_curve,
102 0 /* precompute_mult */, 103 .point_cmp = ec_GFp_simple_cmp,
103 0 /* have_precompute_mult */, 104 .make_affine = ec_GFp_simple_make_affine,
104 ec_GFp_nist_field_mul, 105 .points_make_affine = ec_GFp_simple_points_make_affine,
105 ec_GFp_nist_field_sqr, 106 .field_mul = ec_GFp_nist_field_mul,
106 0 /* field_div */, 107 .field_sqr = ec_GFp_nist_field_sqr
107 0 /* field_encode */, 108 };
108 0 /* field_decode */,
109 0 /* field_set_to_one */ };
110 109
111 return &ret; 110 return &ret;
112 } 111}
113 112
114int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src) 113int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
115 { 114 {
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nistp224.c b/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
index 03f2d9c1d7..696024a549 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
@@ -233,51 +233,51 @@ typedef struct {
233 int references; 233 int references;
234} NISTP224_PRE_COMP; 234} NISTP224_PRE_COMP;
235 235
236const EC_METHOD *EC_GFp_nistp224_method(void) 236const EC_METHOD *
237 { 237EC_GFp_nistp224_method(void)
238{
238 static const EC_METHOD ret = { 239 static const EC_METHOD ret = {
239 EC_FLAGS_DEFAULT_OCT, 240 .flags = EC_FLAGS_DEFAULT_OCT,
240 NID_X9_62_prime_field, 241 .field_type = NID_X9_62_prime_field,
241 ec_GFp_nistp224_group_init, 242 .group_init = ec_GFp_nistp224_group_init,
242 ec_GFp_simple_group_finish, 243 .group_finish = ec_GFp_simple_group_finish,
243 ec_GFp_simple_group_clear_finish, 244 .group_clear_finish = ec_GFp_simple_group_clear_finish,
244 ec_GFp_nist_group_copy, 245 .group_copy = ec_GFp_nist_group_copy,
245 ec_GFp_nistp224_group_set_curve, 246 .group_set_curve = ec_GFp_nistp224_group_set_curve,
246 ec_GFp_simple_group_get_curve, 247 .group_get_curve = ec_GFp_simple_group_get_curve,
247 ec_GFp_simple_group_get_degree, 248 .group_get_degree = ec_GFp_simple_group_get_degree,
248 ec_GFp_simple_group_check_discriminant, 249 .group_check_discriminant =
249 ec_GFp_simple_point_init, 250 ec_GFp_simple_group_check_discriminant,
250 ec_GFp_simple_point_finish, 251 .point_init = ec_GFp_simple_point_init,
251 ec_GFp_simple_point_clear_finish, 252 .point_finish = ec_GFp_simple_point_finish,
252 ec_GFp_simple_point_copy, 253 .point_clear_finish = ec_GFp_simple_point_clear_finish,
253 ec_GFp_simple_point_set_to_infinity, 254 .point_copy = ec_GFp_simple_point_copy,
254 ec_GFp_simple_set_Jprojective_coordinates_GFp, 255 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
255 ec_GFp_simple_get_Jprojective_coordinates_GFp, 256 .point_set_Jprojective_coordinates_GFp =
256 ec_GFp_simple_point_set_affine_coordinates, 257 ec_GFp_simple_set_Jprojective_coordinates_GFp,
257 ec_GFp_nistp224_point_get_affine_coordinates, 258 .point_get_Jprojective_coordinates_GFp =
258 0 /* point_set_compressed_coordinates */, 259 ec_GFp_simple_get_Jprojective_coordinates_GFp,
259 0 /* point2oct */, 260 .point_set_affine_coordinates =
260 0 /* oct2point */, 261 ec_GFp_simple_point_set_affine_coordinates,
261 ec_GFp_simple_add, 262 .point_get_affine_coordinates =
262 ec_GFp_simple_dbl, 263 ec_GFp_nistp224_point_get_affine_coordinates,
263 ec_GFp_simple_invert, 264 .add = ec_GFp_simple_add,
264 ec_GFp_simple_is_at_infinity, 265 .dbl = ec_GFp_simple_dbl,
265 ec_GFp_simple_is_on_curve, 266 .invert = ec_GFp_simple_invert,
266 ec_GFp_simple_cmp, 267 .is_at_infinity = ec_GFp_simple_is_at_infinity,
267 ec_GFp_simple_make_affine, 268 .is_on_curve = ec_GFp_simple_is_on_curve,
268 ec_GFp_simple_points_make_affine, 269 .point_cmp = ec_GFp_simple_cmp,
269 ec_GFp_nistp224_points_mul, 270 .make_affine = ec_GFp_simple_make_affine,
270 ec_GFp_nistp224_precompute_mult, 271 .points_make_affine = ec_GFp_simple_points_make_affine,
271 ec_GFp_nistp224_have_precompute_mult, 272 .mul = ec_GFp_nistp224_points_mul,
272 ec_GFp_nist_field_mul, 273 .precompute_mult = ec_GFp_nistp224_precompute_mult,
273 ec_GFp_nist_field_sqr, 274 .have_precompute_mult = ec_GFp_nistp224_have_precompute_mult,
274 0 /* field_div */, 275 .field_mul = ec_GFp_nist_field_mul,
275 0 /* field_encode */, 276 .field_sqr = ec_GFp_nist_field_sqr
276 0 /* field_decode */, 277 };
277 0 /* field_set_to_one */ };
278 278
279 return &ret; 279 return &ret;
280 } 280}
281 281
282/* Helper functions to convert field elements to/from internal representation */ 282/* Helper functions to convert field elements to/from internal representation */
283static void bin28_to_felem(felem out, const u8 in[28]) 283static void bin28_to_felem(felem out, const u8 in[28])
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nistp256.c b/src/lib/libssl/src/crypto/ec/ecp_nistp256.c
index 947fb7eee0..132ca0d250 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_nistp256.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_nistp256.c
@@ -1613,51 +1613,51 @@ typedef struct {
1613 int references; 1613 int references;
1614} NISTP256_PRE_COMP; 1614} NISTP256_PRE_COMP;
1615 1615
1616const EC_METHOD *EC_GFp_nistp256_method(void) 1616const EC_METHOD *
1617 { 1617EC_GFp_nistp256_method(void)
1618{
1618 static const EC_METHOD ret = { 1619 static const EC_METHOD ret = {
1619 EC_FLAGS_DEFAULT_OCT, 1620 .flags = EC_FLAGS_DEFAULT_OCT,
1620 NID_X9_62_prime_field, 1621 .field_type = NID_X9_62_prime_field,
1621 ec_GFp_nistp256_group_init, 1622 .group_init = ec_GFp_nistp256_group_init,
1622 ec_GFp_simple_group_finish, 1623 .group_finish = ec_GFp_simple_group_finish,
1623 ec_GFp_simple_group_clear_finish, 1624 .group_clear_finish = ec_GFp_simple_group_clear_finish,
1624 ec_GFp_nist_group_copy, 1625 .group_copy = ec_GFp_nist_group_copy,
1625 ec_GFp_nistp256_group_set_curve, 1626 .group_set_curve = ec_GFp_nistp256_group_set_curve,
1626 ec_GFp_simple_group_get_curve, 1627 .group_get_curve = ec_GFp_simple_group_get_curve,
1627 ec_GFp_simple_group_get_degree, 1628 .group_get_degree = ec_GFp_simple_group_get_degree,
1628 ec_GFp_simple_group_check_discriminant, 1629 .group_check_discriminant =
1629 ec_GFp_simple_point_init, 1630 ec_GFp_simple_group_check_discriminant,
1630 ec_GFp_simple_point_finish, 1631 .point_init = ec_GFp_simple_point_init,
1631 ec_GFp_simple_point_clear_finish, 1632 .point_finish = ec_GFp_simple_point_finish,
1632 ec_GFp_simple_point_copy, 1633 .point_clear_finish = ec_GFp_simple_point_clear_finish,
1633 ec_GFp_simple_point_set_to_infinity, 1634 .point_copy = ec_GFp_simple_point_copy,
1634 ec_GFp_simple_set_Jprojective_coordinates_GFp, 1635 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
1635 ec_GFp_simple_get_Jprojective_coordinates_GFp, 1636 .point_set_Jprojective_coordinates_GFp =
1636 ec_GFp_simple_point_set_affine_coordinates, 1637 ec_GFp_simple_set_Jprojective_coordinates_GFp,
1637 ec_GFp_nistp256_point_get_affine_coordinates, 1638 .point_get_Jprojective_coordinates_GFp =
1638 0 /* point_set_compressed_coordinates */, 1639 ec_GFp_simple_get_Jprojective_coordinates_GFp,
1639 0 /* point2oct */, 1640 .point_set_affine_coordinates =
1640 0 /* oct2point */, 1641 ec_GFp_simple_point_set_affine_coordinates,
1641 ec_GFp_simple_add, 1642 .point_get_affine_coordinates =
1642 ec_GFp_simple_dbl, 1643 ec_GFp_nistp256_point_get_affine_coordinates,
1643 ec_GFp_simple_invert, 1644 .add = ec_GFp_simple_add,
1644 ec_GFp_simple_is_at_infinity, 1645 .dbl = ec_GFp_simple_dbl,
1645 ec_GFp_simple_is_on_curve, 1646 .invert = ec_GFp_simple_invert,
1646 ec_GFp_simple_cmp, 1647 .is_at_infinity = ec_GFp_simple_is_at_infinity,
1647 ec_GFp_simple_make_affine, 1648 .is_on_curve = ec_GFp_simple_is_on_curve,
1648 ec_GFp_simple_points_make_affine, 1649 .point_cmp = ec_GFp_simple_cmp,
1649 ec_GFp_nistp256_points_mul, 1650 .make_affine = ec_GFp_simple_make_affine,
1650 ec_GFp_nistp256_precompute_mult, 1651 .points_make_affine = ec_GFp_simple_points_make_affine,
1651 ec_GFp_nistp256_have_precompute_mult, 1652 .mul = ec_GFp_nistp256_points_mul,
1652 ec_GFp_nist_field_mul, 1653 .precompute_mult = ec_GFp_nistp256_precompute_mult,
1653 ec_GFp_nist_field_sqr, 1654 .have_precompute_mult = ec_GFp_nistp256_have_precompute_mult,
1654 0 /* field_div */, 1655 .field_mul = ec_GFp_nist_field_mul,
1655 0 /* field_encode */, 1656 .field_sqr = ec_GFp_nist_field_sqr
1656 0 /* field_decode */, 1657 };
1657 0 /* field_set_to_one */ };
1658 1658
1659 return &ret; 1659 return &ret;
1660 } 1660}
1661 1661
1662/******************************************************************************/ 1662/******************************************************************************/
1663/* FUNCTIONS TO MANAGE PRECOMPUTATION 1663/* FUNCTIONS TO MANAGE PRECOMPUTATION
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nistp521.c b/src/lib/libssl/src/crypto/ec/ecp_nistp521.c
index 24eb032951..c34c38b7e8 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_nistp521.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_nistp521.c
@@ -1479,51 +1479,51 @@ typedef struct {
1479 int references; 1479 int references;
1480} NISTP521_PRE_COMP; 1480} NISTP521_PRE_COMP;
1481 1481
1482const EC_METHOD *EC_GFp_nistp521_method(void) 1482const EC_METHOD *
1483 { 1483EC_GFp_nistp521_method(void)
1484{
1484 static const EC_METHOD ret = { 1485 static const EC_METHOD ret = {
1485 EC_FLAGS_DEFAULT_OCT, 1486 .flags = EC_FLAGS_DEFAULT_OCT,
1486 NID_X9_62_prime_field, 1487 .field_type = NID_X9_62_prime_field,
1487 ec_GFp_nistp521_group_init, 1488 .group_init = ec_GFp_nistp521_group_init,
1488 ec_GFp_simple_group_finish, 1489 .group_finish = ec_GFp_simple_group_finish,
1489 ec_GFp_simple_group_clear_finish, 1490 .group_clear_finish = ec_GFp_simple_group_clear_finish,
1490 ec_GFp_nist_group_copy, 1491 .group_copy = ec_GFp_nist_group_copy,
1491 ec_GFp_nistp521_group_set_curve, 1492 .group_set_curve = ec_GFp_nistp521_group_set_curve,
1492 ec_GFp_simple_group_get_curve, 1493 .group_get_curve = ec_GFp_simple_group_get_curve,
1493 ec_GFp_simple_group_get_degree, 1494 .group_get_degree = ec_GFp_simple_group_get_degree,
1494 ec_GFp_simple_group_check_discriminant, 1495 .group_check_discriminant =
1495 ec_GFp_simple_point_init, 1496 ec_GFp_simple_group_check_discriminant,
1496 ec_GFp_simple_point_finish, 1497 .point_init = ec_GFp_simple_point_init,
1497 ec_GFp_simple_point_clear_finish, 1498 .point_finish = ec_GFp_simple_point_finish,
1498 ec_GFp_simple_point_copy, 1499 .point_clear_finish = ec_GFp_simple_point_clear_finish,
1499 ec_GFp_simple_point_set_to_infinity, 1500 .point_copy = ec_GFp_simple_point_copy,
1500 ec_GFp_simple_set_Jprojective_coordinates_GFp, 1501 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
1501 ec_GFp_simple_get_Jprojective_coordinates_GFp, 1502 .point_set_Jprojective_coordinates_GFp =
1502 ec_GFp_simple_point_set_affine_coordinates, 1503 ec_GFp_simple_set_Jprojective_coordinates_GFp,
1503 ec_GFp_nistp521_point_get_affine_coordinates, 1504 .point_get_Jprojective_coordinates_GFp =
1504 0 /* point_set_compressed_coordinates */, 1505 ec_GFp_simple_get_Jprojective_coordinates_GFp,
1505 0 /* point2oct */, 1506 .point_set_affine_coordinates =
1506 0 /* oct2point */, 1507 ec_GFp_simple_point_set_affine_coordinates,
1507 ec_GFp_simple_add, 1508 .point_get_affine_coordinates =
1508 ec_GFp_simple_dbl, 1509 ec_GFp_nistp521_point_get_affine_coordinates,
1509 ec_GFp_simple_invert, 1510 .add = ec_GFp_simple_add,
1510 ec_GFp_simple_is_at_infinity, 1511 .dbl = ec_GFp_simple_dbl,
1511 ec_GFp_simple_is_on_curve, 1512 .invert = ec_GFp_simple_invert,
1512 ec_GFp_simple_cmp, 1513 .is_at_infinity = ec_GFp_simple_is_at_infinity,
1513 ec_GFp_simple_make_affine, 1514 .is_on_curve = ec_GFp_simple_is_on_curve,
1514 ec_GFp_simple_points_make_affine, 1515 .point_cmp = ec_GFp_simple_cmp,
1515 ec_GFp_nistp521_points_mul, 1516 .make_affine = ec_GFp_simple_make_affine,
1516 ec_GFp_nistp521_precompute_mult, 1517 .points_make_affine = ec_GFp_simple_points_make_affine,
1517 ec_GFp_nistp521_have_precompute_mult, 1518 .mul = ec_GFp_nistp521_points_mul,
1518 ec_GFp_nist_field_mul, 1519 .precompute_mult = ec_GFp_nistp521_precompute_mult,
1519 ec_GFp_nist_field_sqr, 1520 .have_precompulte_mult = ec_GFp_nistp521_have_precompute_mult,
1520 0 /* field_div */, 1521 .field_mul = ec_GFp_nist_field_mul,
1521 0 /* field_encode */, 1522 .field_sqr = ec_GFp_nist_field_sqr
1522 0 /* field_decode */, 1523 };
1523 0 /* field_set_to_one */ };
1524 1524
1525 return &ret; 1525 return &ret;
1526 } 1526}
1527 1527
1528 1528
1529/******************************************************************************/ 1529/******************************************************************************/
diff --git a/src/lib/libssl/src/crypto/ec/ecp_smpl.c b/src/lib/libssl/src/crypto/ec/ecp_smpl.c
index a146752817..c99348f08f 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_smpl.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_smpl.c
@@ -66,49 +66,48 @@
66 66
67#include "ec_lcl.h" 67#include "ec_lcl.h"
68 68
69const EC_METHOD *EC_GFp_simple_method(void) 69const EC_METHOD *
70 { 70EC_GFp_simple_method(void)
71{
71 static const EC_METHOD ret = { 72 static const EC_METHOD ret = {
72 EC_FLAGS_DEFAULT_OCT, 73 .flags = EC_FLAGS_DEFAULT_OCT,
73 NID_X9_62_prime_field, 74 .field_type = NID_X9_62_prime_field,
74 ec_GFp_simple_group_init, 75 .group_init = ec_GFp_simple_group_init,
75 ec_GFp_simple_group_finish, 76 .group_finish = ec_GFp_simple_group_finish,
76 ec_GFp_simple_group_clear_finish, 77 .group_clear_finish = ec_GFp_simple_group_clear_finish,
77 ec_GFp_simple_group_copy, 78 .group_copy = ec_GFp_simple_group_copy,
78 ec_GFp_simple_group_set_curve, 79 .group_set_curve = ec_GFp_simple_group_set_curve,
79 ec_GFp_simple_group_get_curve, 80 .group_get_curve = ec_GFp_simple_group_get_curve,
80 ec_GFp_simple_group_get_degree, 81 .group_get_degree = ec_GFp_simple_group_get_degree,
81 ec_GFp_simple_group_check_discriminant, 82 .group_check_discriminant =
82 ec_GFp_simple_point_init, 83 ec_GFp_simple_group_check_discriminant,
83 ec_GFp_simple_point_finish, 84 .point_init = ec_GFp_simple_point_init,
84 ec_GFp_simple_point_clear_finish, 85 .point_finish = ec_GFp_simple_point_finish,
85 ec_GFp_simple_point_copy, 86 .point_clear_finish = ec_GFp_simple_point_clear_finish,
86 ec_GFp_simple_point_set_to_infinity, 87 .point_copy = ec_GFp_simple_point_copy,
87 ec_GFp_simple_set_Jprojective_coordinates_GFp, 88 .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
88 ec_GFp_simple_get_Jprojective_coordinates_GFp, 89 .point_set_Jprojective_coordinates_GFp =
89 ec_GFp_simple_point_set_affine_coordinates, 90 ec_GFp_simple_set_Jprojective_coordinates_GFp,
90 ec_GFp_simple_point_get_affine_coordinates, 91 .point_get_Jprojective_coordinates_GFp =
91 0,0,0, 92 ec_GFp_simple_get_Jprojective_coordinates_GFp,
92 ec_GFp_simple_add, 93 .point_set_affine_coordinates =
93 ec_GFp_simple_dbl, 94 ec_GFp_simple_point_set_affine_coordinates,
94 ec_GFp_simple_invert, 95 .point_get_affine_coordinates =
95 ec_GFp_simple_is_at_infinity, 96 ec_GFp_simple_point_get_affine_coordinates,
96 ec_GFp_simple_is_on_curve, 97 .add = ec_GFp_simple_add,
97 ec_GFp_simple_cmp, 98 .dbl = ec_GFp_simple_dbl,
98 ec_GFp_simple_make_affine, 99 .invert = ec_GFp_simple_invert,
99 ec_GFp_simple_points_make_affine, 100 .is_at_infinity = ec_GFp_simple_is_at_infinity,
100 0 /* mul */, 101 .is_on_curve = ec_GFp_simple_is_on_curve,
101 0 /* precompute_mult */, 102 .point_cmp = ec_GFp_simple_cmp,
102 0 /* have_precompute_mult */, 103 .make_affine = ec_GFp_simple_make_affine,
103 ec_GFp_simple_field_mul, 104 .points_make_affine = ec_GFp_simple_points_make_affine,
104 ec_GFp_simple_field_sqr, 105 .field_mul = ec_GFp_simple_field_mul,
105 0 /* field_div */, 106 .field_sqr = ec_GFp_simple_field_sqr
106 0 /* field_encode */, 107 };
107 0 /* field_decode */,
108 0 /* field_set_to_one */ };
109 108
110 return &ret; 109 return &ret;
111 } 110}
112 111
113 112
114/* Most method functions in this file are designed to work with 113/* Most method functions in this file are designed to work with
diff --git a/src/lib/libssl/src/crypto/ecdh/ech_ossl.c b/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
index a63eb4922d..129475f7bb 100644
--- a/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
+++ b/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
@@ -84,14 +84,8 @@ static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
84 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); 84 void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));
85 85
86static ECDH_METHOD openssl_ecdh_meth = { 86static ECDH_METHOD openssl_ecdh_meth = {
87 "OpenSSL ECDH method", 87 .name = "OpenSSL ECDH method",
88 ecdh_compute_key, 88 .compute_key = ecdh_compute_key
89#if 0
90 NULL, /* init */
91 NULL, /* finish */
92#endif
93 0, /* flags */
94 NULL /* app_data */
95}; 89};
96 90
97const ECDH_METHOD *ECDH_OpenSSL(void) 91const ECDH_METHOD *ECDH_OpenSSL(void)
diff --git a/src/lib/libssl/src/crypto/ecdsa/ecs_ossl.c b/src/lib/libssl/src/crypto/ecdsa/ecs_ossl.c
index 7725935610..4a6e04e946 100644
--- a/src/lib/libssl/src/crypto/ecdsa/ecs_ossl.c
+++ b/src/lib/libssl/src/crypto/ecdsa/ecs_ossl.c
@@ -69,16 +69,10 @@ static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
69 const ECDSA_SIG *sig, EC_KEY *eckey); 69 const ECDSA_SIG *sig, EC_KEY *eckey);
70 70
71static ECDSA_METHOD openssl_ecdsa_meth = { 71static ECDSA_METHOD openssl_ecdsa_meth = {
72 "OpenSSL ECDSA method", 72 .name = "OpenSSL ECDSA method",
73 ecdsa_do_sign, 73 .ecdsa_do_sign = ecdsa_do_sign,
74 ecdsa_sign_setup, 74 .ecdsa_sign_setup = ecdsa_sign_setup,
75 ecdsa_do_verify, 75 .ecdsa_do_verify = ecdsa_do_verify
76#if 0
77 NULL, /* init */
78 NULL, /* finish */
79#endif
80 0, /* flags */
81 NULL /* app_data */
82}; 76};
83 77
84const ECDSA_METHOD *ECDSA_OpenSSL(void) 78const ECDSA_METHOD *ECDSA_OpenSSL(void)
diff --git a/src/lib/libssl/src/crypto/engine/eng_padlock.c b/src/lib/libssl/src/crypto/engine/eng_padlock.c
index d5d9a16bf2..c27181ba75 100644
--- a/src/lib/libssl/src/crypto/engine/eng_padlock.c
+++ b/src/lib/libssl/src/crypto/engine/eng_padlock.c
@@ -1086,12 +1086,9 @@ padlock_rand_status(void)
1086 1086
1087/* Prepare structure for registration */ 1087/* Prepare structure for registration */
1088static RAND_METHOD padlock_rand = { 1088static RAND_METHOD padlock_rand = {
1089 NULL, /* seed */ 1089 .bytes = padlock_rand_bytes,
1090 padlock_rand_bytes, /* bytes */ 1090 .pseudorand = padlock_rand_bytes,
1091 NULL, /* cleanup */ 1091 .status = padlock_rand_status
1092 NULL, /* add */
1093 padlock_rand_bytes, /* pseudorand */
1094 padlock_rand_status, /* rand status */
1095}; 1092};
1096 1093
1097#else /* !COMPILE_HW_PADLOCK */ 1094#else /* !COMPILE_HW_PADLOCK */
diff --git a/src/lib/libssl/src/crypto/engine/eng_rdrand.c b/src/lib/libssl/src/crypto/engine/eng_rdrand.c
index 4e9e91d54b..ba1b5bfbff 100644
--- a/src/lib/libssl/src/crypto/engine/eng_rdrand.c
+++ b/src/lib/libssl/src/crypto/engine/eng_rdrand.c
@@ -84,15 +84,11 @@ static int get_random_bytes (unsigned char *buf, int num)
84static int random_status (void) 84static int random_status (void)
85{ return 1; } 85{ return 1; }
86 86
87static RAND_METHOD rdrand_meth = 87static RAND_METHOD rdrand_meth = {
88 { 88 .bytes = get_random_bytes,
89 NULL, /* seed */ 89 .pseudorand = get_random_bytes,
90 get_random_bytes, 90 .status = random_status
91 NULL, /* cleanup */ 91};
92 NULL, /* add */
93 get_random_bytes,
94 random_status,
95 };
96 92
97static int rdrand_init(ENGINE *e) 93static int rdrand_init(ENGINE *e)
98{ return 1; } 94{ return 1; }
diff --git a/src/lib/libssl/src/crypto/engine/eng_rsax.c b/src/lib/libssl/src/crypto/engine/eng_rsax.c
index fa9159499d..c0f6851601 100644
--- a/src/lib/libssl/src/crypto/engine/eng_rsax.c
+++ b/src/lib/libssl/src/crypto/engine/eng_rsax.c
@@ -116,22 +116,12 @@ static const ENGINE_CMD_DEFN e_rsax_cmd_defns[] = {
116 116
117#ifndef OPENSSL_NO_RSA 117#ifndef OPENSSL_NO_RSA
118/* Our internal RSA_METHOD that we provide pointers to */ 118/* Our internal RSA_METHOD that we provide pointers to */
119static RSA_METHOD e_rsax_rsa = 119static RSA_METHOD e_rsax_rsa = {
120 { 120 .name = "Intel RSA-X method",
121 "Intel RSA-X method", 121 .rsa_mod_exp = e_rsax_rsa_mod_exp,
122 NULL, 122 .finish = e_rsax_rsa_finish,
123 NULL, 123 .flags = RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
124 NULL, 124};
125 NULL,
126 e_rsax_rsa_mod_exp,
127 NULL,
128 NULL,
129 e_rsax_rsa_finish,
130 RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
131 NULL,
132 NULL,
133 NULL
134 };
135#endif 125#endif
136 126
137/* Constants used when creating the ENGINE */ 127/* Constants used when creating the ENGINE */
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 190dcc4f75..9b24511b69 100644
--- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -1039,19 +1039,7 @@ err:
1039} 1039}
1040 1040
1041static RSA_METHOD cryptodev_rsa = { 1041static RSA_METHOD cryptodev_rsa = {
1042 "cryptodev RSA method", 1042 .name = "cryptodev RSA method"
1043 NULL, /* rsa_pub_enc */
1044 NULL, /* rsa_pub_dec */
1045 NULL, /* rsa_priv_enc */
1046 NULL, /* rsa_priv_dec */
1047 NULL,
1048 NULL,
1049 NULL, /* init */
1050 NULL, /* finish */
1051 0, /* flags */
1052 NULL, /* app_data */
1053 NULL, /* rsa_sign */
1054 NULL /* rsa_verify */
1055}; 1043};
1056 1044
1057static int 1045static int
@@ -1181,16 +1169,7 @@ err:
1181} 1169}
1182 1170
1183static DSA_METHOD cryptodev_dsa = { 1171static DSA_METHOD cryptodev_dsa = {
1184 "cryptodev DSA method", 1172 .name = "cryptodev DSA method"
1185 NULL,
1186 NULL, /* dsa_sign_setup */
1187 NULL,
1188 NULL, /* dsa_mod_exp */
1189 NULL,
1190 NULL, /* init */
1191 NULL, /* finish */
1192 0, /* flags */
1193 NULL /* app_data */
1194}; 1173};
1195 1174
1196static int 1175static int
@@ -1244,14 +1223,7 @@ err:
1244} 1223}
1245 1224
1246static DH_METHOD cryptodev_dh = { 1225static DH_METHOD cryptodev_dh = {
1247 "cryptodev DH method", 1226 .name = "cryptodev DH method"
1248 NULL, /* cryptodev_dh_generate_key */
1249 NULL,
1250 NULL,
1251 NULL,
1252 NULL,
1253 0, /* flags */
1254 NULL /* app_data */
1255}; 1227};
1256 1228
1257/* 1229/*
diff --git a/src/lib/libssl/src/crypto/evp/bio_b64.c b/src/lib/libssl/src/crypto/evp/bio_b64.c
index 27fc587ca8..02631ec05a 100644
--- a/src/lib/libssl/src/crypto/evp/bio_b64.c
+++ b/src/lib/libssl/src/crypto/evp/bio_b64.c
@@ -91,18 +91,17 @@ typedef struct b64_struct
91 char tmp[B64_BLOCK_SIZE]; 91 char tmp[B64_BLOCK_SIZE];
92 } BIO_B64_CTX; 92 } BIO_B64_CTX;
93 93
94static BIO_METHOD methods_b64= 94static BIO_METHOD methods_b64= {
95 { 95 .type = BIO_TYPE_BASE64,
96 BIO_TYPE_BASE64,"base64 encoding", 96 .name = "base64 encoding",
97 b64_write, 97 .bwrite = b64_write,
98 b64_read, 98 .bread = b64_read,
99 b64_puts, 99 .bputs = b64_puts,
100 NULL, /* b64_gets, */ 100 .ctrl = b64_ctrl,
101 b64_ctrl, 101 .create = b64_new,
102 b64_new, 102 .destroy = b64_free,
103 b64_free, 103 .callback_ctrl = b64_callback_ctrl
104 b64_callback_ctrl, 104};
105 };
106 105
107BIO_METHOD *BIO_f_base64(void) 106BIO_METHOD *BIO_f_base64(void)
108 { 107 {
diff --git a/src/lib/libssl/src/crypto/evp/bio_enc.c b/src/lib/libssl/src/crypto/evp/bio_enc.c
index 8fe9a45e48..3362c25768 100644
--- a/src/lib/libssl/src/crypto/evp/bio_enc.c
+++ b/src/lib/libssl/src/crypto/evp/bio_enc.c
@@ -87,18 +87,16 @@ typedef struct enc_struct
87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2]; 87 char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
88 } BIO_ENC_CTX; 88 } BIO_ENC_CTX;
89 89
90static BIO_METHOD methods_enc= 90static BIO_METHOD methods_enc= {
91 { 91 .type = BIO_TYPE_CIPHER,
92 BIO_TYPE_CIPHER,"cipher", 92 .name = "cipher",
93 enc_write, 93 .bwrite = enc_write,
94 enc_read, 94 .bread = enc_read,
95 NULL, /* enc_puts, */ 95 .ctrl = enc_ctrl,
96 NULL, /* enc_gets, */ 96 .create = enc_new,
97 enc_ctrl, 97 .destroy = enc_free,
98 enc_new, 98 .callback_ctrl = enc_callback_ctrl
99 enc_free, 99};
100 enc_callback_ctrl,
101 };
102 100
103BIO_METHOD *BIO_f_cipher(void) 101BIO_METHOD *BIO_f_cipher(void)
104 { 102 {
diff --git a/src/lib/libssl/src/crypto/evp/bio_md.c b/src/lib/libssl/src/crypto/evp/bio_md.c
index 144fdfd56a..85eead6c95 100644
--- a/src/lib/libssl/src/crypto/evp/bio_md.c
+++ b/src/lib/libssl/src/crypto/evp/bio_md.c
@@ -74,18 +74,17 @@ static int md_new(BIO *h);
74static int md_free(BIO *data); 74static int md_free(BIO *data);
75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp); 75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
76 76
77static BIO_METHOD methods_md= 77static BIO_METHOD methods_md = {
78 { 78 .type = BIO_TYPE_MD,
79 BIO_TYPE_MD,"message digest", 79 .name = "message digest",
80 md_write, 80 .bwrite = md_write,
81 md_read, 81 .bread = md_read,
82 NULL, /* md_puts, */ 82 .bgets = md_gets,
83 md_gets, 83 .ctrl = md_ctrl,
84 md_ctrl, 84 .create = md_new,
85 md_new, 85 .destroy = md_free,
86 md_free, 86 .callback_ctrl = md_callback_ctrl
87 md_callback_ctrl, 87};
88 };
89 88
90BIO_METHOD *BIO_f_md(void) 89BIO_METHOD *BIO_f_md(void)
91 { 90 {
diff --git a/src/lib/libssl/src/crypto/evp/bio_ok.c b/src/lib/libssl/src/crypto/evp/bio_ok.c
index 09a762ffac..d0bcbc2bef 100644
--- a/src/lib/libssl/src/crypto/evp/bio_ok.c
+++ b/src/lib/libssl/src/crypto/evp/bio_ok.c
@@ -157,18 +157,16 @@ typedef struct ok_struct
157 unsigned char buf[IOBS]; 157 unsigned char buf[IOBS];
158 } BIO_OK_CTX; 158 } BIO_OK_CTX;
159 159
160static BIO_METHOD methods_ok= 160static BIO_METHOD methods_ok = {
161 { 161 .type = BIO_TYPE_CIPHER,
162 BIO_TYPE_CIPHER,"reliable", 162 .name = "reliable",
163 ok_write, 163 .bwrite = ok_write,
164 ok_read, 164 .bread = ok_read,
165 NULL, /* ok_puts, */ 165 .ctrl = ok_ctrl,
166 NULL, /* ok_gets, */ 166 .create = ok_new,
167 ok_ctrl, 167 .destroy = ok_free,
168 ok_new, 168 .callback_ctrl = ok_callback_ctrl
169 ok_free, 169};
170 ok_callback_ctrl,
171 };
172 170
173BIO_METHOD *BIO_f_reliable(void) 171BIO_METHOD *BIO_f_reliable(void)
174 { 172 {
diff --git a/src/lib/libssl/src/crypto/hmac/hm_ameth.c b/src/lib/libssl/src/crypto/hmac/hm_ameth.c
index fbada40d9c..0625b06651 100644
--- a/src/lib/libssl/src/crypto/hmac/hm_ameth.c
+++ b/src/lib/libssl/src/crypto/hmac/hm_ameth.c
@@ -138,30 +138,20 @@ static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder)
138 138
139#endif 139#endif
140 140
141const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = 141const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
142 { 142 .pkey_id = EVP_PKEY_HMAC,
143 EVP_PKEY_HMAC, 143 .pkey_base_id = EVP_PKEY_HMAC,
144 EVP_PKEY_HMAC,
145 0,
146
147 "HMAC",
148 "OpenSSL HMAC method",
149
150 0,0,0,0,
151 144
152 0,0,0, 145 .pem_str = "HMAC",
146 .info = "OpenSSL HMAC method",
153 147
154 hmac_size, 148 .pkey_size = hmac_size,
155 0,
156 0,0,0,0,0,0,0,
157 149
158 hmac_key_free, 150 .pkey_free = hmac_key_free,
159 hmac_pkey_ctrl, 151 .pkey_ctrl = hmac_pkey_ctrl,
160#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT 152#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
161 old_hmac_decode, 153 .old_priv_decode = old_hmac_decode,
162 old_hmac_encode 154 .old_priv_encode = old_hmac_encode
163#else
164 0,0
165#endif 155#endif
166 }; 156 };
167 157
diff --git a/src/lib/libssl/src/crypto/hmac/hm_pmeth.c b/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
index f1c67329d0..4d287724c3 100644
--- a/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
+++ b/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
@@ -235,37 +235,18 @@ static int pkey_hmac_ctrl_str(EVP_PKEY_CTX *ctx,
235 return -2; 235 return -2;
236 } 236 }
237 237
238const EVP_PKEY_METHOD hmac_pkey_meth = 238const EVP_PKEY_METHOD hmac_pkey_meth = {
239 { 239 .pkey_id = EVP_PKEY_HMAC,
240 EVP_PKEY_HMAC,
241 0,
242 pkey_hmac_init,
243 pkey_hmac_copy,
244 pkey_hmac_cleanup,
245
246 0, 0,
247
248 0,
249 pkey_hmac_keygen,
250
251 0, 0,
252
253 0, 0,
254
255 0,0,
256
257 hmac_signctx_init,
258 hmac_signctx,
259
260 0,0,
261
262 0,0,
263 240
264 0,0, 241 .init = pkey_hmac_init,
242 .copy = pkey_hmac_copy,
243 .cleanup = pkey_hmac_cleanup,
265 244
266 0,0, 245 .keygen = pkey_hmac_keygen,
267 246
268 pkey_hmac_ctrl, 247 .signctx_init = hmac_signctx_init,
269 pkey_hmac_ctrl_str 248 .signctx = hmac_signctx,
270 249
271 }; 250 .ctrl = pkey_hmac_ctrl,
251 .ctrl_str = pkey_hmac_ctrl_str
252};
diff --git a/src/lib/libssl/src/crypto/pkcs7/bio_ber.c b/src/lib/libssl/src/crypto/pkcs7/bio_ber.c
index d787495a21..216d237b4d 100644
--- a/src/lib/libssl/src/crypto/pkcs7/bio_ber.c
+++ b/src/lib/libssl/src/crypto/pkcs7/bio_ber.c
@@ -106,18 +106,16 @@ typedef struct bio_ber_struct
106 unsigned char buf[BER_BUF_SIZE]; 106 unsigned char buf[BER_BUF_SIZE];
107 } BIO_BER_CTX; 107 } BIO_BER_CTX;
108 108
109static BIO_METHOD methods_ber= 109static BIO_METHOD methods_ber = {
110 { 110 .type = BIO_TYPE_CIPHER,
111 BIO_TYPE_CIPHER,"cipher", 111 .name = "cipher",
112 ber_write, 112 .bwrite = ber_write,
113 ber_read, 113 .bread = ber_read,
114 NULL, /* ber_puts, */ 114 .ctrl = ber_ctrl,
115 NULL, /* ber_gets, */ 115 .create = ber_new,
116 ber_ctrl, 116 .destroy = ber_free,
117 ber_new, 117 .callback_ctrl = ber_callback_ctrl
118 ber_free, 118};
119 ber_callback_ctrl,
120 };
121 119
122BIO_METHOD *BIO_f_ber(void) 120BIO_METHOD *BIO_f_ber(void)
123 { 121 {
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
index fdd11835ad..f0a346a70e 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
@@ -657,42 +657,40 @@ static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
657 return 2; 657 return 2;
658 } 658 }
659 659
660const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = 660const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
661 { 661 {
662 { 662 .pkey_id = EVP_PKEY_RSA,
663 EVP_PKEY_RSA, 663 .pkey_base_id = EVP_PKEY_RSA,
664 EVP_PKEY_RSA, 664 .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
665 ASN1_PKEY_SIGPARAM_NULL,
666 665
667 "RSA", 666 .pem_str = "RSA",
668 "OpenSSL RSA method", 667 .info = "OpenSSL RSA method",
669 668
670 rsa_pub_decode, 669 .pub_decode = rsa_pub_decode,
671 rsa_pub_encode, 670 .pub_encode = rsa_pub_encode,
672 rsa_pub_cmp, 671 .pub_cmp = rsa_pub_cmp,
673 rsa_pub_print, 672 .pub_print = rsa_pub_print,
674 673
675 rsa_priv_decode, 674 .priv_decode = rsa_priv_decode,
676 rsa_priv_encode, 675 .priv_encode = rsa_priv_encode,
677 rsa_priv_print, 676 .priv_print = rsa_priv_print,
678 677
679 int_rsa_size, 678 .pkey_size = int_rsa_size,
680 rsa_bits, 679 .pkey_bits = rsa_bits,
681 680
682 0,0,0,0,0,0, 681 .sig_print = rsa_sig_print,
683 682
684 rsa_sig_print, 683 .pkey_free = int_rsa_free,
685 int_rsa_free, 684 .pkey_ctrl = rsa_pkey_ctrl,
686 rsa_pkey_ctrl, 685 .old_priv_decode = old_rsa_priv_decode,
687 old_rsa_priv_decode, 686 .old_priv_encode = old_rsa_priv_encode,
688 old_rsa_priv_encode, 687 .item_verify = rsa_item_verify,
689 rsa_item_verify, 688 .item_sign = rsa_item_sign
690 rsa_item_sign 689 },
691 },
692 690
693 { 691 {
694 EVP_PKEY_RSA2, 692 .pkey_id = EVP_PKEY_RSA2,
695 EVP_PKEY_RSA, 693 .pkey_base_id = EVP_PKEY_RSA,
696 ASN1_PKEY_ALIAS 694 .pkey_flags = ASN1_PKEY_ALIAS
697 } 695 }
698 }; 696};
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_eay.c b/src/lib/libssl/src/crypto/rsa/rsa_eay.c
index dcf0c16a8f..845e28877e 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_eay.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_eay.c
@@ -128,22 +128,17 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
128static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); 128static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
129static int RSA_eay_init(RSA *rsa); 129static int RSA_eay_init(RSA *rsa);
130static int RSA_eay_finish(RSA *rsa); 130static int RSA_eay_finish(RSA *rsa);
131static RSA_METHOD rsa_pkcs1_eay_meth={ 131static RSA_METHOD rsa_pkcs1_eay_meth = {
132 "Eric Young's PKCS#1 RSA", 132 .name = "Eric Young's PKCS#1 RSA",
133 RSA_eay_public_encrypt, 133 .rsa_pub_enc = RSA_eay_public_encrypt,
134 RSA_eay_public_decrypt, /* signature verification */ 134 .rsa_pub_dec = RSA_eay_public_decrypt, /* signature verification */
135 RSA_eay_private_encrypt, /* signing */ 135 .rsa_priv_enc = RSA_eay_private_encrypt, /* signing */
136 RSA_eay_private_decrypt, 136 .rsa_priv_dec = RSA_eay_private_decrypt,
137 RSA_eay_mod_exp, 137 .rsa_mod_exp = RSA_eay_mod_exp,
138 BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */ 138 .bn_mod_exp = BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
139 RSA_eay_init, 139 .init = RSA_eay_init,
140 RSA_eay_finish, 140 .finish = RSA_eay_finish,
141 0, /* flags */ 141};
142 NULL,
143 0, /* rsa_sign */
144 0, /* rsa_verify */
145 NULL /* rsa_keygen */
146 };
147 142
148const RSA_METHOD *RSA_PKCS1_SSLeay(void) 143const RSA_METHOD *RSA_PKCS1_SSLeay(void)
149 { 144 {
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_null.c b/src/lib/libssl/src/crypto/rsa/rsa_null.c
index 2f2202f142..5b9317cb6c 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_null.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_null.c
@@ -82,22 +82,15 @@ static int RSA_null_mod_exp(const BIGNUM *r0, const BIGNUM *i, RSA *rsa);
82#endif 82#endif
83static int RSA_null_init(RSA *rsa); 83static int RSA_null_init(RSA *rsa);
84static int RSA_null_finish(RSA *rsa); 84static int RSA_null_finish(RSA *rsa);
85static RSA_METHOD rsa_null_meth={ 85static RSA_METHOD rsa_null_meth = {
86 "Null RSA", 86 .name = "Null RSA",
87 RSA_null_public_encrypt, 87 .rsa_pub_enc = RSA_null_public_encrypt,
88 RSA_null_public_decrypt, 88 .rsa_pub_dec = RSA_null_public_decrypt,
89 RSA_null_private_encrypt, 89 .rsa_priv_enc = RSA_null_private_encrypt,
90 RSA_null_private_decrypt, 90 .rsa_priv_dec = RSA_null_private_decrypt,
91 NULL, 91 .init = RSA_null_init,
92 NULL, 92 .finish = RSA_null_finish,
93 RSA_null_init, 93};
94 RSA_null_finish,
95 0,
96 NULL,
97 NULL,
98 NULL,
99 NULL
100 };
101 94
102const RSA_METHOD *RSA_null_method(void) 95const RSA_METHOD *RSA_null_method(void)
103 { 96 {
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
index adec632b3b..09ef090172 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
@@ -609,41 +609,26 @@ static int pkey_rsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
609 return ret; 609 return ret;
610 } 610 }
611 611
612const EVP_PKEY_METHOD rsa_pkey_meth = 612const EVP_PKEY_METHOD rsa_pkey_meth = {
613 { 613 .pkey_id = EVP_PKEY_RSA,
614 EVP_PKEY_RSA, 614 .flags = EVP_PKEY_FLAG_AUTOARGLEN,
615 EVP_PKEY_FLAG_AUTOARGLEN,
616 pkey_rsa_init,
617 pkey_rsa_copy,
618 pkey_rsa_cleanup,
619
620 0,0,
621
622 0,
623 pkey_rsa_keygen,
624
625 0,
626 pkey_rsa_sign,
627
628 0,
629 pkey_rsa_verify,
630
631 0,
632 pkey_rsa_verifyrecover,
633 615
616 .init = pkey_rsa_init,
617 .copy = pkey_rsa_copy,
618 .cleanup = pkey_rsa_cleanup,
634 619
635 0,0,0,0, 620 .keygen = pkey_rsa_keygen,
636 621
637 0, 622 .sign = pkey_rsa_sign,
638 pkey_rsa_encrypt,
639 623
640 0, 624 .verify = pkey_rsa_verify,
641 pkey_rsa_decrypt,
642 625
643 0,0, 626 .verify_recover = pkey_rsa_verifyrecover,
644 627
645 pkey_rsa_ctrl, 628 .encrypt = pkey_rsa_encrypt,
646 pkey_rsa_ctrl_str
647 629
630 .decrypt = pkey_rsa_decrypt,
648 631
649 }; 632 .ctrl = pkey_rsa_ctrl,
633 .ctrl_str = pkey_rsa_ctrl_str
634};
diff --git a/src/lib/libssl/src/crypto/store/str_mem.c b/src/lib/libssl/src/crypto/store/str_mem.c
index 997e60fe93..a73279c86b 100644
--- a/src/lib/libssl/src/crypto/store/str_mem.c
+++ b/src/lib/libssl/src/crypto/store/str_mem.c
@@ -133,25 +133,22 @@ static int mem_unlock(STORE *s, OPENSSL_ITEM attributes[],
133 OPENSSL_ITEM parameters[]); 133 OPENSSL_ITEM parameters[]);
134static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void)); 134static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void));
135 135
136static STORE_METHOD store_memory = 136static STORE_METHOD store_memory = {
137 { 137 .name = "OpenSSL memory store interface",
138 "OpenSSL memory store interface", 138 .init = mem_init,
139 mem_init, 139 .clean = mem_clean,
140 mem_clean, 140 .generate_object = mem_generate,
141 mem_generate, 141 .get_object = mem_get,
142 mem_get, 142 .store_object = mem_store,
143 mem_store, 143 .modify_object = mem_modify,
144 mem_modify, 144 .delete_object = mem_delete,
145 NULL, /* revoke */ 145 .list_object_start = mem_list_start,
146 mem_delete, 146 .list_object_next = mem_list_next,
147 mem_list_start, 147 .list_object_end = mem_list_end,
148 mem_list_next, 148 .list_object_endp = mem_list_endp,
149 mem_list_end, 149 .lock_store = mem_lock,
150 mem_list_endp, 150 .unlock_store = mem_unlock,
151 NULL, /* update */ 151 .ctrl = mem_ctrl
152 mem_lock,
153 mem_unlock,
154 mem_ctrl
155 }; 152 };
156 153
157const STORE_METHOD *STORE_Memory(void) 154const STORE_METHOD *STORE_Memory(void)
diff --git a/src/lib/libssl/src/crypto/ui/ui_openssl.c b/src/lib/libssl/src/crypto/ui/ui_openssl.c
index d3be332f19..3b79ecaf02 100644
--- a/src/lib/libssl/src/crypto/ui/ui_openssl.c
+++ b/src/lib/libssl/src/crypto/ui/ui_openssl.c
@@ -157,13 +157,11 @@ static int noecho_console(UI *ui);
157static int close_console(UI *ui); 157static int close_console(UI *ui);
158 158
159static UI_METHOD ui_openssl = { 159static UI_METHOD ui_openssl = {
160 "OpenSSL default user interface", 160 .name = "OpenSSL default user interface",
161 open_console, 161 .ui_open_session = open_console,
162 write_string, 162 .ui_write_string = write_string,
163 NULL, /* No flusher is needed for command lines */ 163 .ui_read_string = read_string,
164 read_string, 164 .ui_close_session = close_console,
165 close_console,
166 NULL
167}; 165};
168 166
169/* The method with all the built-in thingies */ 167/* The method with all the built-in thingies */