asn1_bio_state_t other_state);
static BIO_METHOD methods_asn1 = {
- BIO_TYPE_ASN1,
- "asn1",
- asn1_bio_write,
- asn1_bio_read,
- asn1_bio_puts,
- asn1_bio_gets,
- asn1_bio_ctrl,
- asn1_bio_new,
- asn1_bio_free,
- asn1_bio_callback_ctrl,
+ .type = BIO_TYPE_ASN1,
+ .name = "asn1",
+ .bwrite = asn1_bio_write,
+ .bread = asn1_bio_read,
+ .bputs = asn1_bio_puts,
+ .bgets = asn1_bio_gets,
+ .ctrl = asn1_bio_ctrl,
+ .create = asn1_bio_new,
+ .destroy = asn1_bio_free,
+ .callback_ctrl = asn1_bio_callback_ctrl
};
BIO_METHOD *
ASN1_INTEGER *serial, X509_NAME *issuer);
static X509_CRL_METHOD int_crl_meth = {
- 0,
- 0,
- 0,
- def_crl_lookup,
- def_crl_verify
+ .crl_lookup = def_crl_lookup,
+ .crl_verify = def_crl_verify
};
static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
#define DEFAULT_BUFFER_SIZE 4096
static BIO_METHOD methods_buffer = {
- BIO_TYPE_BUFFER,
- "buffer",
- buffer_write,
- buffer_read,
- buffer_puts,
- buffer_gets,
- buffer_ctrl,
- buffer_new,
- buffer_free,
- buffer_callback_ctrl,
+ .type = BIO_TYPE_BUFFER,
+ .name = "buffer",
+ .bwrite = buffer_write,
+ .bread = buffer_read,
+ .bputs = buffer_puts,
+ .bgets = buffer_gets,
+ .ctrl = buffer_ctrl,
+ .create = buffer_new,
+ .destroy = buffer_free,
+ .callback_ctrl = buffer_callback_ctrl
};
BIO_METHOD *
/* #define DEBUG */
static BIO_METHOD methods_linebuffer = {
- BIO_TYPE_LINEBUFFER,
- "linebuffer",
- linebuffer_write,
- linebuffer_read,
- linebuffer_puts,
- linebuffer_gets,
- linebuffer_ctrl,
- linebuffer_new,
- linebuffer_free,
- linebuffer_callback_ctrl,
+ .type = BIO_TYPE_LINEBUFFER,
+ .name = "linebuffer",
+ .bwrite = linebuffer_write,
+ .bread = linebuffer_read,
+ .bputs = linebuffer_puts,
+ .bgets = linebuffer_gets,
+ .ctrl = linebuffer_ctrl,
+ .create = linebuffer_new,
+ .destroy = linebuffer_free,
+ .callback_ctrl = linebuffer_callback_ctrl
};
BIO_METHOD *
} NBIO_TEST;
static BIO_METHOD methods_nbiof = {
- BIO_TYPE_NBIO_TEST,
- "non-blocking IO test filter",
- nbiof_write,
- nbiof_read,
- nbiof_puts,
- nbiof_gets,
- nbiof_ctrl,
- nbiof_new,
- nbiof_free,
- nbiof_callback_ctrl,
+ .type = BIO_TYPE_NBIO_TEST,
+ .name = "non-blocking IO test filter",
+ .bwrite = nbiof_write,
+ .bread = nbiof_read,
+ .bputs = nbiof_puts,
+ .bgets = nbiof_gets,
+ .ctrl = nbiof_ctrl,
+ .create = nbiof_new,
+ .destroy = nbiof_free,
+ .callback_ctrl = nbiof_callback_ctrl
};
BIO_METHOD *
static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
static BIO_METHOD methods_nullf = {
- BIO_TYPE_NULL_FILTER,
- "NULL filter",
- nullf_write,
- nullf_read,
- nullf_puts,
- nullf_gets,
- nullf_ctrl,
- nullf_new,
- nullf_free,
- nullf_callback_ctrl,
+ .type = BIO_TYPE_NULL_FILTER,
+ .name = "NULL filter",
+ .bwrite = nullf_write,
+ .bread = nullf_read,
+ .bputs = nullf_puts,
+ .bgets = nullf_gets,
+ .ctrl = nullf_ctrl,
+ .create = nullf_new,
+ .destroy = nullf_free,
+ .callback_ctrl = nullf_callback_ctrl
};
BIO_METHOD *
#define ACPT_S_OK 3
static BIO_METHOD methods_acceptp = {
- BIO_TYPE_ACCEPT,
- "socket accept",
- acpt_write,
- acpt_read,
- acpt_puts,
- NULL, /* connect_gets, */
- acpt_ctrl,
- acpt_new,
- acpt_free,
- NULL,
+ .type = BIO_TYPE_ACCEPT,
+ .name = "socket accept",
+ .bwrite = acpt_write,
+ .bread = acpt_read,
+ .bputs = acpt_puts,
+ .ctrl = acpt_ctrl,
+ .create = acpt_new,
+ .destroy = acpt_free
};
BIO_METHOD *
static void bio_destroy_pair(BIO *bio);
static BIO_METHOD methods_biop = {
- BIO_TYPE_BIO,
- "BIO pair",
- bio_write,
- bio_read,
- bio_puts,
- NULL /* no bio_gets */,
- bio_ctrl,
- bio_new,
- bio_free,
- NULL /* no bio_callback_ctrl */
+ .type = BIO_TYPE_BIO,
+ .name = "BIO pair",
+ .bwrite = bio_write,
+ .bread = bio_read,
+ .bputs = bio_puts,
+ .ctrl = bio_ctrl,
+ .create = bio_new,
+ .destroy = bio_free
};
BIO_METHOD *
void BIO_CONNECT_free(BIO_CONNECT *a);
static BIO_METHOD methods_connectp = {
- BIO_TYPE_CONNECT,
- "socket connect",
- conn_write,
- conn_read,
- conn_puts,
- NULL, /* connect_gets, */
- conn_ctrl,
- conn_new,
- conn_free,
- conn_callback_ctrl,
+ .type = BIO_TYPE_CONNECT,
+ .name = "socket connect",
+ .bwrite = conn_write,
+ .bread = conn_read,
+ .bputs = conn_puts,
+ .ctrl = conn_ctrl,
+ .create = conn_new,
+ .destroy = conn_free,
+ .callback_ctrl = conn_callback_ctrl
};
static int
static void get_current_time(struct timeval *t);
static BIO_METHOD methods_dgramp = {
- BIO_TYPE_DGRAM,
- "datagram socket",
- dgram_write,
- dgram_read,
- dgram_puts,
- NULL, /* dgram_gets, */
- dgram_ctrl,
- dgram_new,
- dgram_free,
- NULL,
+ .type = BIO_TYPE_DGRAM,
+ .name = "datagram socket",
+ .bwrite = dgram_write,
+ .bread = dgram_read,
+ .bputs = dgram_puts,
+ .ctrl = dgram_ctrl,
+ .create = dgram_new,
+ .destroy = dgram_free
};
#ifndef OPENSSL_NO_SCTP
static BIO_METHOD methods_dgramp_sctp = {
- BIO_TYPE_DGRAM_SCTP,
- "datagram sctp socket",
- dgram_sctp_write,
- dgram_sctp_read,
- dgram_sctp_puts,
- NULL, /* dgram_gets, */
- dgram_sctp_ctrl,
- dgram_sctp_new,
- dgram_sctp_free,
- NULL,
+ .type = BIO_TYPE_DGRAM_SCTP,
+ .name = "datagram sctp socket",
+ .bwrite = dgram_sctp_write,
+ .bread = dgram_sctp_read,
+ .bputs = dgram_sctp_puts,
+ .ctrl = dgram_sctp_ctrl,
+ .create = dgram_sctp_new,
+ .destroy = dgram_sctp_free
};
#endif
int BIO_fd_should_retry(int s);
static BIO_METHOD methods_fdp = {
- BIO_TYPE_FD, "file descriptor",
- fd_write,
- fd_read,
- fd_puts,
- fd_gets,
- fd_ctrl,
- fd_new,
- fd_free,
- NULL,
+ .type = BIO_TYPE_FD,
+ .name = "file descriptor",
+ .bwrite = fd_write,
+ .bread = fd_read,
+ .bputs = fd_puts,
+ .bgets = fd_gets,
+ .ctrl = fd_ctrl,
+ .create = fd_new,
+ .destroy = fd_free
};
BIO_METHOD *
static int file_free(BIO *data);
static BIO_METHOD methods_filep = {
- BIO_TYPE_FILE,
- "FILE pointer",
- file_write,
- file_read,
- file_puts,
- file_gets,
- file_ctrl,
- file_new,
- file_free,
- NULL,
+ .type = BIO_TYPE_FILE,
+ .name = "FILE pointer",
+ .bwrite = file_write,
+ .bread = file_read,
+ .bputs = file_puts,
+ .bgets = file_gets,
+ .ctrl = file_ctrl,
+ .create = file_new,
+ .destroy = file_free
};
BIO *
static void xcloselog(BIO* bp);
static BIO_METHOD methods_slg = {
- BIO_TYPE_MEM, "syslog",
- slg_write,
- NULL,
- slg_puts,
- NULL,
- slg_ctrl,
- slg_new,
- slg_free,
- NULL,
+ .type = BIO_TYPE_MEM,
+ .name = "syslog",
+ .bwrite = slg_write,
+ .bputs = slg_puts,
+ .ctrl = slg_ctrl,
+ .create = slg_new,
+ .destroy = slg_free
};
BIO_METHOD *
static int mem_free(BIO *data);
static BIO_METHOD mem_method = {
- BIO_TYPE_MEM,
- "memory buffer",
- mem_write,
- mem_read,
- mem_puts,
- mem_gets,
- mem_ctrl,
- mem_new,
- mem_free,
- NULL,
+ .type = BIO_TYPE_MEM,
+ .name = "memory buffer",
+ .bwrite = mem_write,
+ .bread = mem_read,
+ .bputs = mem_puts,
+ .bgets = mem_gets,
+ .ctrl = mem_ctrl,
+ .create = mem_new,
+ .destroy = mem_free
};
/* bio->num is used to hold the value to return on 'empty', if it is
static int null_free(BIO *data);
static BIO_METHOD null_method = {
- BIO_TYPE_NULL,
- "NULL",
- null_write,
- null_read,
- null_puts,
- null_gets,
- null_ctrl,
- null_new,
- null_free,
- NULL,
+ .type = BIO_TYPE_NULL,
+ .name = "NULL",
+ .bwrite = null_write,
+ .bread = null_read,
+ .bputs = null_puts,
+ .bgets = null_gets,
+ .ctrl = null_ctrl,
+ .create = null_new,
+ .destroy = null_free
};
BIO_METHOD *
int BIO_sock_should_retry(int s);
static BIO_METHOD methods_sockp = {
- BIO_TYPE_SOCKET,
- "socket",
- sock_write,
- sock_read,
- sock_puts,
- NULL, /* sock_gets, */
- sock_ctrl,
- sock_new,
- sock_free,
- NULL,
+ .type = BIO_TYPE_SOCKET,
+ .name = "socket",
+ .bwrite = sock_write,
+ .bread = sock_read,
+ .bputs = sock_puts,
+ .ctrl = sock_ctrl,
+ .create = sock_new,
+ .destroy = sock_free
};
BIO_METHOD *
CMAC_CTX_free(cmctx);
}
-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,
+const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = {
+ .pkey_id = EVP_PKEY_CMAC,
+ .pkey_base_id = EVP_PKEY_CMAC,
- cmac_size,
- 0,
- 0,0,0,0,0,0,0,
+ .pem_str = "CMAC",
+ .info = "OpenSSL CMAC method",
- cmac_key_free,
- 0,
- 0,0
- };
+ .pkey_size = cmac_size,
+ .pkey_free = cmac_key_free
+};
return -2;
}
-const EVP_PKEY_METHOD cmac_pkey_meth =
- {
- EVP_PKEY_CMAC,
- EVP_PKEY_FLAG_SIGCTX_CUSTOM,
- pkey_cmac_init,
- pkey_cmac_copy,
- pkey_cmac_cleanup,
-
- 0, 0,
-
- 0,
- pkey_cmac_keygen,
-
- 0, 0,
-
- 0, 0,
-
- 0,0,
-
- cmac_signctx_init,
- cmac_signctx,
-
- 0,0,
-
- 0,0,
+const EVP_PKEY_METHOD cmac_pkey_meth = {
+ .pkey_id = EVP_PKEY_CMAC,
+ .flags = EVP_PKEY_FLAG_SIGCTX_CUSTOM,
- 0,0,
+ .init = pkey_cmac_init,
+ .copy = pkey_cmac_copy,
+ .cleanup = pkey_cmac_cleanup,
- 0,0,
+ .keygen = pkey_cmac_keygen,
- pkey_cmac_ctrl,
- pkey_cmac_ctrl_str
+ .signctx_init = cmac_signctx_init,
+ .signctx = cmac_signctx,
- };
+ .ctrl = pkey_cmac_ctrl,
+ .ctrl_str = pkey_cmac_ctrl_str
+};
unsigned int olen, unsigned char *in, unsigned int ilen);
static COMP_METHOD rle_method = {
- NID_rle_compression,
- LN_rle_compression,
- NULL,
- NULL,
- rle_compress_block,
- rle_expand_block,
- NULL,
- NULL,
+ .type = NID_rle_compression,
+ .name = LN_rle_compression,
+ .compress = rle_compress_block,
+ .expand = rle_expand_block
};
COMP_METHOD *
COMP_METHOD *COMP_zlib(void );
static COMP_METHOD zlib_method_nozlib = {
- NID_undef,
- "(undef)",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ .type = NID_undef,
+ .name = "(undef)"
};
#ifndef ZLIB
uLong sourceLen);
static COMP_METHOD zlib_stateless_method = {
- NID_zlib_compression,
- LN_zlib_compression,
- NULL,
- NULL,
- zlib_compress_block,
- zlib_expand_block,
- NULL,
- NULL,
+ .type = NID_zlib_compression,
+ .name = LN_zlib_compression,
+ .compress = zlib_compress_block,
+ .expand = zlib_expand_block
};
#endif
static COMP_METHOD zlib_stateful_method = {
- NID_zlib_compression,
- LN_zlib_compression,
- zlib_stateful_init,
- zlib_stateful_finish,
- zlib_stateful_compress_block,
- zlib_stateful_expand_block,
- NULL,
- NULL,
+ .type = NID_zlib_compression,
+ .name = LN_zlib_compression,
+ .init = zlib_stateful_init,
+ .finish = zlib_stateful_finish,
+ .compress = zlib_stateful_compress_block,
+ .expand = zlib_stateful_expand_block
};
#ifdef ZLIB_SHARED
static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
static BIO_METHOD bio_meth_zlib = {
- BIO_TYPE_COMP,
- "zlib",
- bio_zlib_write,
- bio_zlib_read,
- NULL,
- NULL,
- bio_zlib_ctrl,
- bio_zlib_new,
- bio_zlib_free,
- bio_zlib_callback_ctrl
+ .type = BIO_TYPE_COMP,
+ .name = "zlib",
+ .bwrite = bio_zlib_write,
+ .bread = bio_zlib_read,
+ .ctrl = bio_zlib_ctrl,
+ .create = bio_zlib_new,
+ .destroy = bio_zlib_free,
+ .callback_ctrl = bio_zlib_callback_ctrl
};
BIO_METHOD *
const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
static CONF_METHOD default_method = {
- "OpenSSL default",
- def_create,
- def_init_default,
- def_destroy,
- def_destroy_data,
- def_load_bio,
- def_dump,
- def_is_number,
- def_to_int,
- def_load
+ .name = "OpenSSL default",
+ .create = def_create,
+ .init = def_init_default,
+ .destroy = def_destroy,
+ .destroy_data = def_destroy_data,
+ .load_bio = def_load_bio,
+ .dump = def_dump,
+ .is_number = def_is_number,
+ .to_int = def_to_int,
+ .load = def_load
};
static CONF_METHOD WIN32_method = {
return do_dh_print(bp, x, 4, NULL, 0);
}
-const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
- {
- EVP_PKEY_DH,
- EVP_PKEY_DH,
- 0,
-
- "DH",
- "OpenSSL PKCS#3 DH method",
-
- dh_pub_decode,
- dh_pub_encode,
- dh_pub_cmp,
- dh_public_print,
-
- dh_priv_decode,
- dh_priv_encode,
- dh_private_print,
-
- int_dh_size,
- dh_bits,
-
- dh_param_decode,
- dh_param_encode,
- dh_missing_parameters,
- dh_copy_parameters,
- dh_cmp_parameters,
- dh_param_print,
- 0,
-
- int_dh_free,
- 0
- };
+const EVP_PKEY_ASN1_METHOD dh_asn1_meth = {
+ .pkey_id = EVP_PKEY_DH,
+ .pkey_base_id = EVP_PKEY_DH,
+
+ .pem_str = "DH",
+ .info = "OpenSSL PKCS#3 DH method",
+
+ .pub_decode = dh_pub_decode,
+ .pub_encode = dh_pub_encode,
+ .pub_cmp = dh_pub_cmp,
+ .pub_print = dh_public_print,
+
+ .priv_decode = dh_priv_decode,
+ .priv_encode = dh_priv_encode,
+ .priv_print = dh_private_print,
+
+ .pkey_size = int_dh_size,
+ .pkey_bits = dh_bits,
+
+ .param_decode = dh_param_decode,
+ .param_encode = dh_param_encode,
+ .param_missing = dh_missing_parameters,
+ .param_copy = dh_copy_parameters,
+ .param_cmp = dh_cmp_parameters,
+ .param_print = dh_param_print,
+
+ .pkey_free = int_dh_free,
+};
}
static DH_METHOD dh_ossl = {
-"OpenSSL DH Method",
-generate_key,
-compute_key,
-dh_bn_mod_exp,
-dh_init,
-dh_finish,
-0,
-NULL,
-NULL
+ .name = "OpenSSL DH Method",
+ .generate_key = generate_key,
+ .compute_key = compute_key,
+ .bn_mod_exp = dh_bn_mod_exp,
+ .init = dh_init,
+ .finish = dh_finish,
};
const DH_METHOD *DH_OpenSSL(void)
return 1;
}
-const EVP_PKEY_METHOD dh_pkey_meth =
- {
- EVP_PKEY_DH,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_dh_init,
- pkey_dh_copy,
- pkey_dh_cleanup,
-
- 0,
- pkey_dh_paramgen,
-
- 0,
- pkey_dh_keygen,
-
- 0,
- 0,
-
- 0,
- 0,
-
- 0,0,
-
- 0,0,0,0,
+const EVP_PKEY_METHOD dh_pkey_meth = {
+ .pkey_id = EVP_PKEY_DH,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
- 0,0,
+ .init = pkey_dh_init,
+ .copy = pkey_dh_copy,
+ .cleanup = pkey_dh_cleanup,
- 0,0,
+ .paramgen = pkey_dh_paramgen,
- 0,
- pkey_dh_derive,
+ .keygen = pkey_dh_keygen,
- pkey_dh_ctrl,
- pkey_dh_ctrl_str
+ .derive = pkey_dh_derive,
- };
+ .ctrl = pkey_dh_ctrl,
+ .ctrl_str = pkey_dh_ctrl_str
+};
/* NB these are sorted in pkey_id order, lowest first */
-const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] =
+const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = {
{
+ .pkey_id = EVP_PKEY_DSA2,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA2,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
-
- {
- EVP_PKEY_DSA1,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
-
- {
- EVP_PKEY_DSA4,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
+ {
+ .pkey_id = EVP_PKEY_DSA1,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA3,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
+ {
+ .pkey_id = EVP_PKEY_DSA4,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA,
- EVP_PKEY_DSA,
- 0,
-
- "DSA",
- "OpenSSL DSA method",
-
- dsa_pub_decode,
- dsa_pub_encode,
- dsa_pub_cmp,
- dsa_pub_print,
-
- dsa_priv_decode,
- dsa_priv_encode,
- dsa_priv_print,
-
- int_dsa_size,
- dsa_bits,
-
- dsa_param_decode,
- dsa_param_encode,
- dsa_missing_parameters,
- dsa_copy_parameters,
- dsa_cmp_parameters,
- dsa_param_print,
- dsa_sig_print,
-
- int_dsa_free,
- dsa_pkey_ctrl,
- old_dsa_priv_decode,
- old_dsa_priv_encode
- }
- };
+ {
+ .pkey_id = EVP_PKEY_DSA3,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
+ {
+ .pkey_id = EVP_PKEY_DSA,
+ .pkey_base_id = EVP_PKEY_DSA,
+
+ .pem_str = "DSA",
+ .info = "OpenSSL DSA method",
+
+ .pub_decode = dsa_pub_decode,
+ .pub_encode = dsa_pub_encode,
+ .pub_cmp = dsa_pub_cmp,
+ .pub_print = dsa_pub_print,
+
+ .priv_decode = dsa_priv_decode,
+ .priv_encode = dsa_priv_encode,
+ .priv_print = dsa_priv_print,
+
+ .pkey_size = int_dsa_size,
+ .pkey_bits = dsa_bits,
+
+ .param_decode = dsa_param_decode,
+ .param_encode = dsa_param_encode,
+ .param_missing = dsa_missing_parameters,
+ .param_copy = dsa_copy_parameters,
+ .param_cmp = dsa_cmp_parameters,
+ .param_print = dsa_param_print,
+ .sig_print = dsa_sig_print,
+
+ .pkey_free = int_dsa_free,
+ .pkey_ctrl = dsa_pkey_ctrl,
+ .old_priv_decode = old_dsa_priv_decode,
+ .old_priv_encode = old_dsa_priv_encode
+ }
+};
static int dsa_finish(DSA *dsa);
static DSA_METHOD openssl_dsa_meth = {
-"OpenSSL DSA method",
-dsa_do_sign,
-dsa_sign_setup,
-dsa_do_verify,
-NULL, /* dsa_mod_exp, */
-NULL, /* dsa_bn_mod_exp, */
-dsa_init,
-dsa_finish,
-0,
-NULL,
-NULL,
-NULL
+ .name = "OpenSSL DSA method",
+ .dsa_do_sign = dsa_do_sign,
+ .dsa_sign_setup = dsa_sign_setup,
+ .dsa_do_verify = dsa_do_verify,
+ .init = dsa_init,
+ .finish = dsa_finish
};
/* These macro wrappers replace attempts to use the dsa_mod_exp() and
return DSA_generate_key(pkey->pkey.dsa);
}
-const EVP_PKEY_METHOD dsa_pkey_meth =
- {
- EVP_PKEY_DSA,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_dsa_init,
- pkey_dsa_copy,
- pkey_dsa_cleanup,
-
- 0,
- pkey_dsa_paramgen,
-
- 0,
- pkey_dsa_keygen,
-
- 0,
- pkey_dsa_sign,
-
- 0,
- pkey_dsa_verify,
-
- 0,0,
-
- 0,0,0,0,
+const EVP_PKEY_METHOD dsa_pkey_meth = {
+ .pkey_id = EVP_PKEY_DSA,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
- 0,0,
+ .init = pkey_dsa_init,
+ .copy = pkey_dsa_copy,
+ .cleanup = pkey_dsa_cleanup,
- 0,0,
+ .paramgen = pkey_dsa_paramgen,
- 0,0,
+ .keygen = pkey_dsa_keygen,
- pkey_dsa_ctrl,
- pkey_dsa_ctrl_str
+ .sign = pkey_dsa_sign,
+ .verify = pkey_dsa_verify,
- };
+ .ctrl = pkey_dsa_ctrl,
+ .ctrl_str = pkey_dsa_ctrl_str
+};
static void *dlfcn_globallookup(const char *name);
static DSO_METHOD dso_meth_dlfcn = {
- "OpenSSL 'dlfcn' shared library method",
- dlfcn_load,
- dlfcn_unload,
- dlfcn_bind_var,
- dlfcn_bind_func,
-/* For now, "unbind" doesn't exist */
-#if 0
- NULL, /* unbind_var */
- NULL, /* unbind_func */
-#endif
- NULL, /* ctrl */
- dlfcn_name_converter,
- dlfcn_merger,
- NULL, /* init */
- NULL, /* finish */
- dlfcn_pathbyaddr,
- dlfcn_globallookup
+ .name = "OpenSSL 'dlfcn' shared library method",
+ .dso_load = dlfcn_load,
+ .dso_unload = dlfcn_unload,
+ .dso_bind_var = dlfcn_bind_var,
+ .dso_bind_func = dlfcn_bind_func,
+ .dso_name_converter = dlfcn_name_converter,
+ .dso_merger = dlfcn_merger,
+ .pathbyaddr = dlfcn_pathbyaddr,
+ .globallookup = dlfcn_globallookup
};
DSO_METHOD *
#include <openssl/dso.h>
static DSO_METHOD dso_meth_null = {
- "NULL shared library method",
- NULL, /* load */
- NULL, /* unload */
- NULL, /* bind_var */
- NULL, /* bind_func */
-/* For now, "unbind" doesn't exist */
-#if 0
- NULL, /* unbind_var */
- NULL, /* unbind_func */
-#endif
- NULL, /* ctrl */
- NULL, /* dso_name_converter */
- NULL, /* dso_merger */
- NULL, /* init */
- NULL, /* finish */
- NULL, /* pathbyaddr */
- NULL /* globallookup */
+ .name = "NULL shared library method"
};
DSO_METHOD *
#ifndef OPENSSL_NO_EC2M
-const EC_METHOD *EC_GF2m_simple_method(void)
- {
+const EC_METHOD *
+EC_GF2m_simple_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_characteristic_two_field,
- ec_GF2m_simple_group_init,
- ec_GF2m_simple_group_finish,
- ec_GF2m_simple_group_clear_finish,
- ec_GF2m_simple_group_copy,
- ec_GF2m_simple_group_set_curve,
- ec_GF2m_simple_group_get_curve,
- ec_GF2m_simple_group_get_degree,
- ec_GF2m_simple_group_check_discriminant,
- ec_GF2m_simple_point_init,
- ec_GF2m_simple_point_finish,
- ec_GF2m_simple_point_clear_finish,
- ec_GF2m_simple_point_copy,
- ec_GF2m_simple_point_set_to_infinity,
- 0 /* set_Jprojective_coordinates_GFp */,
- 0 /* get_Jprojective_coordinates_GFp */,
- ec_GF2m_simple_point_set_affine_coordinates,
- ec_GF2m_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GF2m_simple_add,
- ec_GF2m_simple_dbl,
- ec_GF2m_simple_invert,
- ec_GF2m_simple_is_at_infinity,
- ec_GF2m_simple_is_on_curve,
- ec_GF2m_simple_cmp,
- ec_GF2m_simple_make_affine,
- ec_GF2m_simple_points_make_affine,
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_characteristic_two_field,
+ .group_init = ec_GF2m_simple_group_init,
+ .group_finish = ec_GF2m_simple_group_finish,
+ .group_clear_finish = ec_GF2m_simple_group_clear_finish,
+ .group_copy = ec_GF2m_simple_group_copy,
+ .group_set_curve = ec_GF2m_simple_group_set_curve,
+ .group_get_curve = ec_GF2m_simple_group_get_curve,
+ .group_get_degree = ec_GF2m_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GF2m_simple_group_check_discriminant,
+ .point_init = ec_GF2m_simple_point_init,
+ .point_finish = ec_GF2m_simple_point_finish,
+ .point_clear_finish = ec_GF2m_simple_point_clear_finish,
+ .point_copy = ec_GF2m_simple_point_copy,
+ .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity,
+ .point_set_affine_coordinates =
+ ec_GF2m_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GF2m_simple_point_get_affine_coordinates,
+ .add = ec_GF2m_simple_add,
+ .dbl = ec_GF2m_simple_dbl,
+ .invert = ec_GF2m_simple_invert,
+ .is_at_infinity = ec_GF2m_simple_is_at_infinity,
+ .is_on_curve = ec_GF2m_simple_is_on_curve,
+ .point_cmp = ec_GF2m_simple_cmp,
+ .make_affine = ec_GF2m_simple_make_affine,
+ .points_make_affine = ec_GF2m_simple_points_make_affine,
/* the following three method functions are defined in ec2_mult.c */
- ec_GF2m_simple_mul,
- ec_GF2m_precompute_mult,
- ec_GF2m_have_precompute_mult,
+ .mul = ec_GF2m_simple_mul,
+ .precompute_mult = ec_GF2m_precompute_mult,
+ .have_precompute_mult = ec_GF2m_have_precompute_mult,
- ec_GF2m_simple_field_mul,
- ec_GF2m_simple_field_sqr,
- ec_GF2m_simple_field_div,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .field_mul = ec_GF2m_simple_field_mul,
+ .field_sqr = ec_GF2m_simple_field_sqr,
+ .field_div = ec_GF2m_simple_field_div,
+ };
return &ret;
- }
+}
/* Initialize a GF(2^m)-based EC_GROUP structure.
}
-const EVP_PKEY_ASN1_METHOD eckey_asn1_meth =
- {
- EVP_PKEY_EC,
- EVP_PKEY_EC,
- 0,
- "EC",
- "OpenSSL EC algorithm",
-
- eckey_pub_decode,
- eckey_pub_encode,
- eckey_pub_cmp,
- eckey_pub_print,
-
- eckey_priv_decode,
- eckey_priv_encode,
- eckey_priv_print,
-
- int_ec_size,
- ec_bits,
-
- eckey_param_decode,
- eckey_param_encode,
- ec_missing_parameters,
- ec_copy_parameters,
- ec_cmp_parameters,
- eckey_param_print,
- 0,
-
- int_ec_free,
- ec_pkey_ctrl,
- old_ec_priv_decode,
- old_ec_priv_encode
- };
+const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
+ .pkey_id = EVP_PKEY_EC,
+ .pkey_base_id = EVP_PKEY_EC,
+
+ .pem_str = "EC",
+ .info = "OpenSSL EC algorithm",
+
+ .pub_decode = eckey_pub_decode,
+ .pub_encode = eckey_pub_encode,
+ .pub_cmp = eckey_pub_cmp,
+ .pub_print = eckey_pub_print,
+
+ .priv_decode = eckey_priv_decode,
+ .priv_encode = eckey_priv_encode,
+ .priv_print = eckey_priv_print,
+
+ .pkey_size = int_ec_size,
+ .pkey_bits = ec_bits,
+
+ .param_decode = eckey_param_decode,
+ .param_encode = eckey_param_encode,
+ .param_missing = ec_missing_parameters,
+ .param_copy = ec_copy_parameters,
+ .param_cmp = ec_cmp_parameters,
+ .param_print = eckey_param_print,
+
+ .pkey_free = int_ec_free,
+ .pkey_ctrl = ec_pkey_ctrl,
+ .old_priv_decode = old_ec_priv_decode,
+ .old_priv_encode = old_ec_priv_encode
+};
return EC_KEY_generate_key(pkey->pkey.ec);
}
-const EVP_PKEY_METHOD ec_pkey_meth =
- {
- EVP_PKEY_EC,
- 0,
- pkey_ec_init,
- pkey_ec_copy,
- pkey_ec_cleanup,
-
- 0,
- pkey_ec_paramgen,
-
- 0,
- pkey_ec_keygen,
-
- 0,
- pkey_ec_sign,
-
- 0,
- pkey_ec_verify,
+const EVP_PKEY_METHOD ec_pkey_meth = {
+ .pkey_id = EVP_PKEY_EC,
- 0,0,
+ .init = pkey_ec_init,
+ .copy = pkey_ec_copy,
+ .cleanup = pkey_ec_cleanup,
- 0,0,0,0,
+ .paramgen = pkey_ec_paramgen,
- 0,0,
+ .keygen = pkey_ec_keygen,
- 0,0,
+ .sign = pkey_ec_sign,
- 0,
- pkey_ec_derive,
+ .verify = pkey_ec_verify,
- pkey_ec_ctrl,
- pkey_ec_ctrl_str
+ .derive = pkey_ec_derive,
- };
+ .ctrl = pkey_ec_ctrl,
+ .ctrl_str = pkey_ec_ctrl_str
+};
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_mont_method(void)
- {
+const EC_METHOD *
+EC_GFp_mont_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_mont_group_init,
- ec_GFp_mont_group_finish,
- ec_GFp_mont_group_clear_finish,
- ec_GFp_mont_group_copy,
- ec_GFp_mont_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_mont_field_mul,
- ec_GFp_mont_field_sqr,
- 0 /* field_div */,
- ec_GFp_mont_field_encode,
- ec_GFp_mont_field_decode,
- ec_GFp_mont_field_set_to_one };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_mont_group_init,
+ .group_finish = ec_GFp_mont_group_finish,
+ .group_clear_finish = ec_GFp_mont_group_clear_finish,
+ .group_copy = ec_GFp_mont_group_copy,
+ .group_set_curve = ec_GFp_mont_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_mont_field_mul,
+ .field_sqr = ec_GFp_mont_field_sqr,
+ .field_encode = ec_GFp_mont_field_encode,
+ .field_decode = ec_GFp_mont_field_decode,
+ .field_set_to_one = ec_GFp_mont_field_set_to_one
+ };
return &ret;
- }
+}
int ec_GFp_mont_group_init(EC_GROUP *group)
#include <openssl/obj_mac.h>
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_nist_method(void)
- {
+const EC_METHOD *
+EC_GFp_nist_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_simple_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nist_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_simple_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nist_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
{
int references;
} NISTP224_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp224_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp224_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp224_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp224_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp224_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp224_points_mul,
- ec_GFp_nistp224_precompute_mult,
- ec_GFp_nistp224_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp224_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp224_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp224_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp224_points_mul,
+ .precompute_mult = ec_GFp_nistp224_precompute_mult,
+ .have_precompute_mult = ec_GFp_nistp224_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/* Helper functions to convert field elements to/from internal representation */
static void bin28_to_felem(felem out, const u8 in[28])
int references;
} NISTP256_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp256_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp256_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp256_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp256_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp256_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp256_points_mul,
- ec_GFp_nistp256_precompute_mult,
- ec_GFp_nistp256_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp256_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp256_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp256_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp256_points_mul,
+ .precompute_mult = ec_GFp_nistp256_precompute_mult,
+ .have_precompute_mult = ec_GFp_nistp256_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/******************************************************************************/
/* FUNCTIONS TO MANAGE PRECOMPUTATION
int references;
} NISTP521_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp521_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp521_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp521_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp521_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp521_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp521_points_mul,
- ec_GFp_nistp521_precompute_mult,
- ec_GFp_nistp521_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp521_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp521_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp521_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp521_points_mul,
+ .precompute_mult = ec_GFp_nistp521_precompute_mult,
+ .have_precompulte_mult = ec_GFp_nistp521_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/******************************************************************************/
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_simple_method(void)
- {
+const EC_METHOD *
+EC_GFp_simple_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_simple_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_simple_group_copy,
- ec_GFp_simple_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_simple_field_mul,
- ec_GFp_simple_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_simple_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_simple_group_copy,
+ .group_set_curve = ec_GFp_simple_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_simple_field_mul,
+ .field_sqr = ec_GFp_simple_field_sqr
+ };
return &ret;
- }
+}
/* Most method functions in this file are designed to work with
void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));
static ECDH_METHOD openssl_ecdh_meth = {
- "OpenSSL ECDH method",
- ecdh_compute_key,
-#if 0
- NULL, /* init */
- NULL, /* finish */
-#endif
- 0, /* flags */
- NULL /* app_data */
+ .name = "OpenSSL ECDH method",
+ .compute_key = ecdh_compute_key
};
const ECDH_METHOD *ECDH_OpenSSL(void)
const ECDSA_SIG *sig, EC_KEY *eckey);
static ECDSA_METHOD openssl_ecdsa_meth = {
- "OpenSSL ECDSA method",
- ecdsa_do_sign,
- ecdsa_sign_setup,
- ecdsa_do_verify,
-#if 0
- NULL, /* init */
- NULL, /* finish */
-#endif
- 0, /* flags */
- NULL /* app_data */
+ .name = "OpenSSL ECDSA method",
+ .ecdsa_do_sign = ecdsa_do_sign,
+ .ecdsa_sign_setup = ecdsa_sign_setup,
+ .ecdsa_do_verify = ecdsa_do_verify
};
const ECDSA_METHOD *ECDSA_OpenSSL(void)
/* Prepare structure for registration */
static RAND_METHOD padlock_rand = {
- NULL, /* seed */
- padlock_rand_bytes, /* bytes */
- NULL, /* cleanup */
- NULL, /* add */
- padlock_rand_bytes, /* pseudorand */
- padlock_rand_status, /* rand status */
+ .bytes = padlock_rand_bytes,
+ .pseudorand = padlock_rand_bytes,
+ .status = padlock_rand_status
};
#else /* !COMPILE_HW_PADLOCK */
static int random_status (void)
{ return 1; }
-static RAND_METHOD rdrand_meth =
- {
- NULL, /* seed */
- get_random_bytes,
- NULL, /* cleanup */
- NULL, /* add */
- get_random_bytes,
- random_status,
- };
+static RAND_METHOD rdrand_meth = {
+ .bytes = get_random_bytes,
+ .pseudorand = get_random_bytes,
+ .status = random_status
+};
static int rdrand_init(ENGINE *e)
{ return 1; }
#ifndef OPENSSL_NO_RSA
/* Our internal RSA_METHOD that we provide pointers to */
-static RSA_METHOD e_rsax_rsa =
- {
- "Intel RSA-X method",
- NULL,
- NULL,
- NULL,
- NULL,
- e_rsax_rsa_mod_exp,
- NULL,
- NULL,
- e_rsax_rsa_finish,
- RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
- NULL,
- NULL,
- NULL
- };
+static RSA_METHOD e_rsax_rsa = {
+ .name = "Intel RSA-X method",
+ .rsa_mod_exp = e_rsax_rsa_mod_exp,
+ .finish = e_rsax_rsa_finish,
+ .flags = RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
+};
#endif
/* Constants used when creating the ENGINE */
}
static RSA_METHOD cryptodev_rsa = {
- "cryptodev RSA method",
- NULL, /* rsa_pub_enc */
- NULL, /* rsa_pub_dec */
- NULL, /* rsa_priv_enc */
- NULL, /* rsa_priv_dec */
- NULL,
- NULL,
- NULL, /* init */
- NULL, /* finish */
- 0, /* flags */
- NULL, /* app_data */
- NULL, /* rsa_sign */
- NULL /* rsa_verify */
+ .name = "cryptodev RSA method"
};
static int
}
static DSA_METHOD cryptodev_dsa = {
- "cryptodev DSA method",
- NULL,
- NULL, /* dsa_sign_setup */
- NULL,
- NULL, /* dsa_mod_exp */
- NULL,
- NULL, /* init */
- NULL, /* finish */
- 0, /* flags */
- NULL /* app_data */
+ .name = "cryptodev DSA method"
};
static int
}
static DH_METHOD cryptodev_dh = {
- "cryptodev DH method",
- NULL, /* cryptodev_dh_generate_key */
- NULL,
- NULL,
- NULL,
- NULL,
- 0, /* flags */
- NULL /* app_data */
+ .name = "cryptodev DH method"
};
/*
char tmp[B64_BLOCK_SIZE];
} BIO_B64_CTX;
-static BIO_METHOD methods_b64=
- {
- BIO_TYPE_BASE64,"base64 encoding",
- b64_write,
- b64_read,
- b64_puts,
- NULL, /* b64_gets, */
- b64_ctrl,
- b64_new,
- b64_free,
- b64_callback_ctrl,
- };
+static BIO_METHOD methods_b64= {
+ .type = BIO_TYPE_BASE64,
+ .name = "base64 encoding",
+ .bwrite = b64_write,
+ .bread = b64_read,
+ .bputs = b64_puts,
+ .ctrl = b64_ctrl,
+ .create = b64_new,
+ .destroy = b64_free,
+ .callback_ctrl = b64_callback_ctrl
+};
BIO_METHOD *BIO_f_base64(void)
{
char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
} BIO_ENC_CTX;
-static BIO_METHOD methods_enc=
- {
- BIO_TYPE_CIPHER,"cipher",
- enc_write,
- enc_read,
- NULL, /* enc_puts, */
- NULL, /* enc_gets, */
- enc_ctrl,
- enc_new,
- enc_free,
- enc_callback_ctrl,
- };
+static BIO_METHOD methods_enc= {
+ .type = BIO_TYPE_CIPHER,
+ .name = "cipher",
+ .bwrite = enc_write,
+ .bread = enc_read,
+ .ctrl = enc_ctrl,
+ .create = enc_new,
+ .destroy = enc_free,
+ .callback_ctrl = enc_callback_ctrl
+};
BIO_METHOD *BIO_f_cipher(void)
{
static int md_free(BIO *data);
static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
-static BIO_METHOD methods_md=
- {
- BIO_TYPE_MD,"message digest",
- md_write,
- md_read,
- NULL, /* md_puts, */
- md_gets,
- md_ctrl,
- md_new,
- md_free,
- md_callback_ctrl,
- };
+static BIO_METHOD methods_md = {
+ .type = BIO_TYPE_MD,
+ .name = "message digest",
+ .bwrite = md_write,
+ .bread = md_read,
+ .bgets = md_gets,
+ .ctrl = md_ctrl,
+ .create = md_new,
+ .destroy = md_free,
+ .callback_ctrl = md_callback_ctrl
+};
BIO_METHOD *BIO_f_md(void)
{
unsigned char buf[IOBS];
} BIO_OK_CTX;
-static BIO_METHOD methods_ok=
- {
- BIO_TYPE_CIPHER,"reliable",
- ok_write,
- ok_read,
- NULL, /* ok_puts, */
- NULL, /* ok_gets, */
- ok_ctrl,
- ok_new,
- ok_free,
- ok_callback_ctrl,
- };
+static BIO_METHOD methods_ok = {
+ .type = BIO_TYPE_CIPHER,
+ .name = "reliable",
+ .bwrite = ok_write,
+ .bread = ok_read,
+ .ctrl = ok_ctrl,
+ .create = ok_new,
+ .destroy = ok_free,
+ .callback_ctrl = ok_callback_ctrl
+};
BIO_METHOD *BIO_f_reliable(void)
{
#endif
-const EVP_PKEY_ASN1_METHOD hmac_asn1_meth =
- {
- EVP_PKEY_HMAC,
- EVP_PKEY_HMAC,
- 0,
-
- "HMAC",
- "OpenSSL HMAC method",
-
- 0,0,0,0,
+const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
+ .pkey_id = EVP_PKEY_HMAC,
+ .pkey_base_id = EVP_PKEY_HMAC,
- 0,0,0,
+ .pem_str = "HMAC",
+ .info = "OpenSSL HMAC method",
- hmac_size,
- 0,
- 0,0,0,0,0,0,0,
+ .pkey_size = hmac_size,
- hmac_key_free,
- hmac_pkey_ctrl,
+ .pkey_free = hmac_key_free,
+ .pkey_ctrl = hmac_pkey_ctrl,
#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
- old_hmac_decode,
- old_hmac_encode
-#else
- 0,0
+ .old_priv_decode = old_hmac_decode,
+ .old_priv_encode = old_hmac_encode
#endif
};
return -2;
}
-const EVP_PKEY_METHOD hmac_pkey_meth =
- {
- EVP_PKEY_HMAC,
- 0,
- pkey_hmac_init,
- pkey_hmac_copy,
- pkey_hmac_cleanup,
-
- 0, 0,
-
- 0,
- pkey_hmac_keygen,
-
- 0, 0,
-
- 0, 0,
-
- 0,0,
-
- hmac_signctx_init,
- hmac_signctx,
-
- 0,0,
-
- 0,0,
+const EVP_PKEY_METHOD hmac_pkey_meth = {
+ .pkey_id = EVP_PKEY_HMAC,
- 0,0,
+ .init = pkey_hmac_init,
+ .copy = pkey_hmac_copy,
+ .cleanup = pkey_hmac_cleanup,
- 0,0,
+ .keygen = pkey_hmac_keygen,
- pkey_hmac_ctrl,
- pkey_hmac_ctrl_str
+ .signctx_init = hmac_signctx_init,
+ .signctx = hmac_signctx,
- };
+ .ctrl = pkey_hmac_ctrl,
+ .ctrl_str = pkey_hmac_ctrl_str
+};
unsigned char buf[BER_BUF_SIZE];
} BIO_BER_CTX;
-static BIO_METHOD methods_ber=
- {
- BIO_TYPE_CIPHER,"cipher",
- ber_write,
- ber_read,
- NULL, /* ber_puts, */
- NULL, /* ber_gets, */
- ber_ctrl,
- ber_new,
- ber_free,
- ber_callback_ctrl,
- };
+static BIO_METHOD methods_ber = {
+ .type = BIO_TYPE_CIPHER,
+ .name = "cipher",
+ .bwrite = ber_write,
+ .bread = ber_read,
+ .ctrl = ber_ctrl,
+ .create = ber_new,
+ .destroy = ber_free,
+ .callback_ctrl = ber_callback_ctrl
+};
BIO_METHOD *BIO_f_ber(void)
{
return 2;
}
-const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] =
+const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
{
- {
- EVP_PKEY_RSA,
- EVP_PKEY_RSA,
- ASN1_PKEY_SIGPARAM_NULL,
+ .pkey_id = EVP_PKEY_RSA,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
- "RSA",
- "OpenSSL RSA method",
+ .pem_str = "RSA",
+ .info = "OpenSSL RSA method",
- rsa_pub_decode,
- rsa_pub_encode,
- rsa_pub_cmp,
- rsa_pub_print,
+ .pub_decode = rsa_pub_decode,
+ .pub_encode = rsa_pub_encode,
+ .pub_cmp = rsa_pub_cmp,
+ .pub_print = rsa_pub_print,
- rsa_priv_decode,
- rsa_priv_encode,
- rsa_priv_print,
+ .priv_decode = rsa_priv_decode,
+ .priv_encode = rsa_priv_encode,
+ .priv_print = rsa_priv_print,
- int_rsa_size,
- rsa_bits,
+ .pkey_size = int_rsa_size,
+ .pkey_bits = rsa_bits,
- 0,0,0,0,0,0,
+ .sig_print = rsa_sig_print,
- rsa_sig_print,
- int_rsa_free,
- rsa_pkey_ctrl,
- old_rsa_priv_decode,
- old_rsa_priv_encode,
- rsa_item_verify,
- rsa_item_sign
- },
+ .pkey_free = int_rsa_free,
+ .pkey_ctrl = rsa_pkey_ctrl,
+ .old_priv_decode = old_rsa_priv_decode,
+ .old_priv_encode = old_rsa_priv_encode,
+ .item_verify = rsa_item_verify,
+ .item_sign = rsa_item_sign
+ },
- {
- EVP_PKEY_RSA2,
- EVP_PKEY_RSA,
- ASN1_PKEY_ALIAS
- }
- };
+ {
+ .pkey_id = EVP_PKEY_RSA2,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ }
+};
static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
static int RSA_eay_init(RSA *rsa);
static int RSA_eay_finish(RSA *rsa);
-static RSA_METHOD rsa_pkcs1_eay_meth={
- "Eric Young's PKCS#1 RSA",
- RSA_eay_public_encrypt,
- RSA_eay_public_decrypt, /* signature verification */
- RSA_eay_private_encrypt, /* signing */
- RSA_eay_private_decrypt,
- RSA_eay_mod_exp,
- BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
- RSA_eay_init,
- RSA_eay_finish,
- 0, /* flags */
- NULL,
- 0, /* rsa_sign */
- 0, /* rsa_verify */
- NULL /* rsa_keygen */
- };
+static RSA_METHOD rsa_pkcs1_eay_meth = {
+ .name = "Eric Young's PKCS#1 RSA",
+ .rsa_pub_enc = RSA_eay_public_encrypt,
+ .rsa_pub_dec = RSA_eay_public_decrypt, /* signature verification */
+ .rsa_priv_enc = RSA_eay_private_encrypt, /* signing */
+ .rsa_priv_dec = RSA_eay_private_decrypt,
+ .rsa_mod_exp = RSA_eay_mod_exp,
+ .bn_mod_exp = BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
+ .init = RSA_eay_init,
+ .finish = RSA_eay_finish,
+};
const RSA_METHOD *RSA_PKCS1_SSLeay(void)
{
#endif
static int RSA_null_init(RSA *rsa);
static int RSA_null_finish(RSA *rsa);
-static RSA_METHOD rsa_null_meth={
- "Null RSA",
- RSA_null_public_encrypt,
- RSA_null_public_decrypt,
- RSA_null_private_encrypt,
- RSA_null_private_decrypt,
- NULL,
- NULL,
- RSA_null_init,
- RSA_null_finish,
- 0,
- NULL,
- NULL,
- NULL,
- NULL
- };
+static RSA_METHOD rsa_null_meth = {
+ .name = "Null RSA",
+ .rsa_pub_enc = RSA_null_public_encrypt,
+ .rsa_pub_dec = RSA_null_public_decrypt,
+ .rsa_priv_enc = RSA_null_private_encrypt,
+ .rsa_priv_dec = RSA_null_private_decrypt,
+ .init = RSA_null_init,
+ .finish = RSA_null_finish,
+};
const RSA_METHOD *RSA_null_method(void)
{
return ret;
}
-const EVP_PKEY_METHOD rsa_pkey_meth =
- {
- EVP_PKEY_RSA,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_rsa_init,
- pkey_rsa_copy,
- pkey_rsa_cleanup,
-
- 0,0,
-
- 0,
- pkey_rsa_keygen,
-
- 0,
- pkey_rsa_sign,
-
- 0,
- pkey_rsa_verify,
-
- 0,
- pkey_rsa_verifyrecover,
+const EVP_PKEY_METHOD rsa_pkey_meth = {
+ .pkey_id = EVP_PKEY_RSA,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
+ .init = pkey_rsa_init,
+ .copy = pkey_rsa_copy,
+ .cleanup = pkey_rsa_cleanup,
- 0,0,0,0,
+ .keygen = pkey_rsa_keygen,
- 0,
- pkey_rsa_encrypt,
+ .sign = pkey_rsa_sign,
- 0,
- pkey_rsa_decrypt,
+ .verify = pkey_rsa_verify,
- 0,0,
+ .verify_recover = pkey_rsa_verifyrecover,
- pkey_rsa_ctrl,
- pkey_rsa_ctrl_str
+ .encrypt = pkey_rsa_encrypt,
+ .decrypt = pkey_rsa_decrypt,
- };
+ .ctrl = pkey_rsa_ctrl,
+ .ctrl_str = pkey_rsa_ctrl_str
+};
OPENSSL_ITEM parameters[]);
static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void));
-static STORE_METHOD store_memory =
- {
- "OpenSSL memory store interface",
- mem_init,
- mem_clean,
- mem_generate,
- mem_get,
- mem_store,
- mem_modify,
- NULL, /* revoke */
- mem_delete,
- mem_list_start,
- mem_list_next,
- mem_list_end,
- mem_list_endp,
- NULL, /* update */
- mem_lock,
- mem_unlock,
- mem_ctrl
+static STORE_METHOD store_memory = {
+ .name = "OpenSSL memory store interface",
+ .init = mem_init,
+ .clean = mem_clean,
+ .generate_object = mem_generate,
+ .get_object = mem_get,
+ .store_object = mem_store,
+ .modify_object = mem_modify,
+ .delete_object = mem_delete,
+ .list_object_start = mem_list_start,
+ .list_object_next = mem_list_next,
+ .list_object_end = mem_list_end,
+ .list_object_endp = mem_list_endp,
+ .lock_store = mem_lock,
+ .unlock_store = mem_unlock,
+ .ctrl = mem_ctrl
};
const STORE_METHOD *STORE_Memory(void)
static int close_console(UI *ui);
static UI_METHOD ui_openssl = {
- "OpenSSL default user interface",
- open_console,
- write_string,
- NULL, /* No flusher is needed for command lines */
- read_string,
- close_console,
- NULL
+ .name = "OpenSSL default user interface",
+ .ui_open_session = open_console,
+ .ui_write_string = write_string,
+ .ui_read_string = read_string,
+ .ui_close_session = close_console,
};
/* The method with all the built-in thingies */
asn1_bio_state_t other_state);
static BIO_METHOD methods_asn1 = {
- BIO_TYPE_ASN1,
- "asn1",
- asn1_bio_write,
- asn1_bio_read,
- asn1_bio_puts,
- asn1_bio_gets,
- asn1_bio_ctrl,
- asn1_bio_new,
- asn1_bio_free,
- asn1_bio_callback_ctrl,
+ .type = BIO_TYPE_ASN1,
+ .name = "asn1",
+ .bwrite = asn1_bio_write,
+ .bread = asn1_bio_read,
+ .bputs = asn1_bio_puts,
+ .bgets = asn1_bio_gets,
+ .ctrl = asn1_bio_ctrl,
+ .create = asn1_bio_new,
+ .destroy = asn1_bio_free,
+ .callback_ctrl = asn1_bio_callback_ctrl
};
BIO_METHOD *
ASN1_INTEGER *serial, X509_NAME *issuer);
static X509_CRL_METHOD int_crl_meth = {
- 0,
- 0,
- 0,
- def_crl_lookup,
- def_crl_verify
+ .crl_lookup = def_crl_lookup,
+ .crl_verify = def_crl_verify
};
static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;
#define DEFAULT_BUFFER_SIZE 4096
static BIO_METHOD methods_buffer = {
- BIO_TYPE_BUFFER,
- "buffer",
- buffer_write,
- buffer_read,
- buffer_puts,
- buffer_gets,
- buffer_ctrl,
- buffer_new,
- buffer_free,
- buffer_callback_ctrl,
+ .type = BIO_TYPE_BUFFER,
+ .name = "buffer",
+ .bwrite = buffer_write,
+ .bread = buffer_read,
+ .bputs = buffer_puts,
+ .bgets = buffer_gets,
+ .ctrl = buffer_ctrl,
+ .create = buffer_new,
+ .destroy = buffer_free,
+ .callback_ctrl = buffer_callback_ctrl
};
BIO_METHOD *
/* #define DEBUG */
static BIO_METHOD methods_linebuffer = {
- BIO_TYPE_LINEBUFFER,
- "linebuffer",
- linebuffer_write,
- linebuffer_read,
- linebuffer_puts,
- linebuffer_gets,
- linebuffer_ctrl,
- linebuffer_new,
- linebuffer_free,
- linebuffer_callback_ctrl,
+ .type = BIO_TYPE_LINEBUFFER,
+ .name = "linebuffer",
+ .bwrite = linebuffer_write,
+ .bread = linebuffer_read,
+ .bputs = linebuffer_puts,
+ .bgets = linebuffer_gets,
+ .ctrl = linebuffer_ctrl,
+ .create = linebuffer_new,
+ .destroy = linebuffer_free,
+ .callback_ctrl = linebuffer_callback_ctrl
};
BIO_METHOD *
} NBIO_TEST;
static BIO_METHOD methods_nbiof = {
- BIO_TYPE_NBIO_TEST,
- "non-blocking IO test filter",
- nbiof_write,
- nbiof_read,
- nbiof_puts,
- nbiof_gets,
- nbiof_ctrl,
- nbiof_new,
- nbiof_free,
- nbiof_callback_ctrl,
+ .type = BIO_TYPE_NBIO_TEST,
+ .name = "non-blocking IO test filter",
+ .bwrite = nbiof_write,
+ .bread = nbiof_read,
+ .bputs = nbiof_puts,
+ .bgets = nbiof_gets,
+ .ctrl = nbiof_ctrl,
+ .create = nbiof_new,
+ .destroy = nbiof_free,
+ .callback_ctrl = nbiof_callback_ctrl
};
BIO_METHOD *
static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
static BIO_METHOD methods_nullf = {
- BIO_TYPE_NULL_FILTER,
- "NULL filter",
- nullf_write,
- nullf_read,
- nullf_puts,
- nullf_gets,
- nullf_ctrl,
- nullf_new,
- nullf_free,
- nullf_callback_ctrl,
+ .type = BIO_TYPE_NULL_FILTER,
+ .name = "NULL filter",
+ .bwrite = nullf_write,
+ .bread = nullf_read,
+ .bputs = nullf_puts,
+ .bgets = nullf_gets,
+ .ctrl = nullf_ctrl,
+ .create = nullf_new,
+ .destroy = nullf_free,
+ .callback_ctrl = nullf_callback_ctrl
};
BIO_METHOD *
#define ACPT_S_OK 3
static BIO_METHOD methods_acceptp = {
- BIO_TYPE_ACCEPT,
- "socket accept",
- acpt_write,
- acpt_read,
- acpt_puts,
- NULL, /* connect_gets, */
- acpt_ctrl,
- acpt_new,
- acpt_free,
- NULL,
+ .type = BIO_TYPE_ACCEPT,
+ .name = "socket accept",
+ .bwrite = acpt_write,
+ .bread = acpt_read,
+ .bputs = acpt_puts,
+ .ctrl = acpt_ctrl,
+ .create = acpt_new,
+ .destroy = acpt_free
};
BIO_METHOD *
static void bio_destroy_pair(BIO *bio);
static BIO_METHOD methods_biop = {
- BIO_TYPE_BIO,
- "BIO pair",
- bio_write,
- bio_read,
- bio_puts,
- NULL /* no bio_gets */,
- bio_ctrl,
- bio_new,
- bio_free,
- NULL /* no bio_callback_ctrl */
+ .type = BIO_TYPE_BIO,
+ .name = "BIO pair",
+ .bwrite = bio_write,
+ .bread = bio_read,
+ .bputs = bio_puts,
+ .ctrl = bio_ctrl,
+ .create = bio_new,
+ .destroy = bio_free
};
BIO_METHOD *
void BIO_CONNECT_free(BIO_CONNECT *a);
static BIO_METHOD methods_connectp = {
- BIO_TYPE_CONNECT,
- "socket connect",
- conn_write,
- conn_read,
- conn_puts,
- NULL, /* connect_gets, */
- conn_ctrl,
- conn_new,
- conn_free,
- conn_callback_ctrl,
+ .type = BIO_TYPE_CONNECT,
+ .name = "socket connect",
+ .bwrite = conn_write,
+ .bread = conn_read,
+ .bputs = conn_puts,
+ .ctrl = conn_ctrl,
+ .create = conn_new,
+ .destroy = conn_free,
+ .callback_ctrl = conn_callback_ctrl
};
static int
static void get_current_time(struct timeval *t);
static BIO_METHOD methods_dgramp = {
- BIO_TYPE_DGRAM,
- "datagram socket",
- dgram_write,
- dgram_read,
- dgram_puts,
- NULL, /* dgram_gets, */
- dgram_ctrl,
- dgram_new,
- dgram_free,
- NULL,
+ .type = BIO_TYPE_DGRAM,
+ .name = "datagram socket",
+ .bwrite = dgram_write,
+ .bread = dgram_read,
+ .bputs = dgram_puts,
+ .ctrl = dgram_ctrl,
+ .create = dgram_new,
+ .destroy = dgram_free
};
#ifndef OPENSSL_NO_SCTP
static BIO_METHOD methods_dgramp_sctp = {
- BIO_TYPE_DGRAM_SCTP,
- "datagram sctp socket",
- dgram_sctp_write,
- dgram_sctp_read,
- dgram_sctp_puts,
- NULL, /* dgram_gets, */
- dgram_sctp_ctrl,
- dgram_sctp_new,
- dgram_sctp_free,
- NULL,
+ .type = BIO_TYPE_DGRAM_SCTP,
+ .name = "datagram sctp socket",
+ .bwrite = dgram_sctp_write,
+ .bread = dgram_sctp_read,
+ .bputs = dgram_sctp_puts,
+ .ctrl = dgram_sctp_ctrl,
+ .create = dgram_sctp_new,
+ .destroy = dgram_sctp_free
};
#endif
int BIO_fd_should_retry(int s);
static BIO_METHOD methods_fdp = {
- BIO_TYPE_FD, "file descriptor",
- fd_write,
- fd_read,
- fd_puts,
- fd_gets,
- fd_ctrl,
- fd_new,
- fd_free,
- NULL,
+ .type = BIO_TYPE_FD,
+ .name = "file descriptor",
+ .bwrite = fd_write,
+ .bread = fd_read,
+ .bputs = fd_puts,
+ .bgets = fd_gets,
+ .ctrl = fd_ctrl,
+ .create = fd_new,
+ .destroy = fd_free
};
BIO_METHOD *
static int file_free(BIO *data);
static BIO_METHOD methods_filep = {
- BIO_TYPE_FILE,
- "FILE pointer",
- file_write,
- file_read,
- file_puts,
- file_gets,
- file_ctrl,
- file_new,
- file_free,
- NULL,
+ .type = BIO_TYPE_FILE,
+ .name = "FILE pointer",
+ .bwrite = file_write,
+ .bread = file_read,
+ .bputs = file_puts,
+ .bgets = file_gets,
+ .ctrl = file_ctrl,
+ .create = file_new,
+ .destroy = file_free
};
BIO *
static void xcloselog(BIO* bp);
static BIO_METHOD methods_slg = {
- BIO_TYPE_MEM, "syslog",
- slg_write,
- NULL,
- slg_puts,
- NULL,
- slg_ctrl,
- slg_new,
- slg_free,
- NULL,
+ .type = BIO_TYPE_MEM,
+ .name = "syslog",
+ .bwrite = slg_write,
+ .bputs = slg_puts,
+ .ctrl = slg_ctrl,
+ .create = slg_new,
+ .destroy = slg_free
};
BIO_METHOD *
static int mem_free(BIO *data);
static BIO_METHOD mem_method = {
- BIO_TYPE_MEM,
- "memory buffer",
- mem_write,
- mem_read,
- mem_puts,
- mem_gets,
- mem_ctrl,
- mem_new,
- mem_free,
- NULL,
+ .type = BIO_TYPE_MEM,
+ .name = "memory buffer",
+ .bwrite = mem_write,
+ .bread = mem_read,
+ .bputs = mem_puts,
+ .bgets = mem_gets,
+ .ctrl = mem_ctrl,
+ .create = mem_new,
+ .destroy = mem_free
};
/* bio->num is used to hold the value to return on 'empty', if it is
static int null_free(BIO *data);
static BIO_METHOD null_method = {
- BIO_TYPE_NULL,
- "NULL",
- null_write,
- null_read,
- null_puts,
- null_gets,
- null_ctrl,
- null_new,
- null_free,
- NULL,
+ .type = BIO_TYPE_NULL,
+ .name = "NULL",
+ .bwrite = null_write,
+ .bread = null_read,
+ .bputs = null_puts,
+ .bgets = null_gets,
+ .ctrl = null_ctrl,
+ .create = null_new,
+ .destroy = null_free
};
BIO_METHOD *
int BIO_sock_should_retry(int s);
static BIO_METHOD methods_sockp = {
- BIO_TYPE_SOCKET,
- "socket",
- sock_write,
- sock_read,
- sock_puts,
- NULL, /* sock_gets, */
- sock_ctrl,
- sock_new,
- sock_free,
- NULL,
+ .type = BIO_TYPE_SOCKET,
+ .name = "socket",
+ .bwrite = sock_write,
+ .bread = sock_read,
+ .bputs = sock_puts,
+ .ctrl = sock_ctrl,
+ .create = sock_new,
+ .destroy = sock_free
};
BIO_METHOD *
CMAC_CTX_free(cmctx);
}
-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,
+const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = {
+ .pkey_id = EVP_PKEY_CMAC,
+ .pkey_base_id = EVP_PKEY_CMAC,
- cmac_size,
- 0,
- 0,0,0,0,0,0,0,
+ .pem_str = "CMAC",
+ .info = "OpenSSL CMAC method",
- cmac_key_free,
- 0,
- 0,0
- };
+ .pkey_size = cmac_size,
+ .pkey_free = cmac_key_free
+};
return -2;
}
-const EVP_PKEY_METHOD cmac_pkey_meth =
- {
- EVP_PKEY_CMAC,
- EVP_PKEY_FLAG_SIGCTX_CUSTOM,
- pkey_cmac_init,
- pkey_cmac_copy,
- pkey_cmac_cleanup,
-
- 0, 0,
-
- 0,
- pkey_cmac_keygen,
-
- 0, 0,
-
- 0, 0,
-
- 0,0,
-
- cmac_signctx_init,
- cmac_signctx,
-
- 0,0,
-
- 0,0,
+const EVP_PKEY_METHOD cmac_pkey_meth = {
+ .pkey_id = EVP_PKEY_CMAC,
+ .flags = EVP_PKEY_FLAG_SIGCTX_CUSTOM,
- 0,0,
+ .init = pkey_cmac_init,
+ .copy = pkey_cmac_copy,
+ .cleanup = pkey_cmac_cleanup,
- 0,0,
+ .keygen = pkey_cmac_keygen,
- pkey_cmac_ctrl,
- pkey_cmac_ctrl_str
+ .signctx_init = cmac_signctx_init,
+ .signctx = cmac_signctx,
- };
+ .ctrl = pkey_cmac_ctrl,
+ .ctrl_str = pkey_cmac_ctrl_str
+};
unsigned int olen, unsigned char *in, unsigned int ilen);
static COMP_METHOD rle_method = {
- NID_rle_compression,
- LN_rle_compression,
- NULL,
- NULL,
- rle_compress_block,
- rle_expand_block,
- NULL,
- NULL,
+ .type = NID_rle_compression,
+ .name = LN_rle_compression,
+ .compress = rle_compress_block,
+ .expand = rle_expand_block
};
COMP_METHOD *
COMP_METHOD *COMP_zlib(void );
static COMP_METHOD zlib_method_nozlib = {
- NID_undef,
- "(undef)",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ .type = NID_undef,
+ .name = "(undef)"
};
#ifndef ZLIB
uLong sourceLen);
static COMP_METHOD zlib_stateless_method = {
- NID_zlib_compression,
- LN_zlib_compression,
- NULL,
- NULL,
- zlib_compress_block,
- zlib_expand_block,
- NULL,
- NULL,
+ .type = NID_zlib_compression,
+ .name = LN_zlib_compression,
+ .compress = zlib_compress_block,
+ .expand = zlib_expand_block
};
#endif
static COMP_METHOD zlib_stateful_method = {
- NID_zlib_compression,
- LN_zlib_compression,
- zlib_stateful_init,
- zlib_stateful_finish,
- zlib_stateful_compress_block,
- zlib_stateful_expand_block,
- NULL,
- NULL,
+ .type = NID_zlib_compression,
+ .name = LN_zlib_compression,
+ .init = zlib_stateful_init,
+ .finish = zlib_stateful_finish,
+ .compress = zlib_stateful_compress_block,
+ .expand = zlib_stateful_expand_block
};
#ifdef ZLIB_SHARED
static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
static BIO_METHOD bio_meth_zlib = {
- BIO_TYPE_COMP,
- "zlib",
- bio_zlib_write,
- bio_zlib_read,
- NULL,
- NULL,
- bio_zlib_ctrl,
- bio_zlib_new,
- bio_zlib_free,
- bio_zlib_callback_ctrl
+ .type = BIO_TYPE_COMP,
+ .name = "zlib",
+ .bwrite = bio_zlib_write,
+ .bread = bio_zlib_read,
+ .ctrl = bio_zlib_ctrl,
+ .create = bio_zlib_new,
+ .destroy = bio_zlib_free,
+ .callback_ctrl = bio_zlib_callback_ctrl
};
BIO_METHOD *
const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
static CONF_METHOD default_method = {
- "OpenSSL default",
- def_create,
- def_init_default,
- def_destroy,
- def_destroy_data,
- def_load_bio,
- def_dump,
- def_is_number,
- def_to_int,
- def_load
+ .name = "OpenSSL default",
+ .create = def_create,
+ .init = def_init_default,
+ .destroy = def_destroy,
+ .destroy_data = def_destroy_data,
+ .load_bio = def_load_bio,
+ .dump = def_dump,
+ .is_number = def_is_number,
+ .to_int = def_to_int,
+ .load = def_load
};
static CONF_METHOD WIN32_method = {
return do_dh_print(bp, x, 4, NULL, 0);
}
-const EVP_PKEY_ASN1_METHOD dh_asn1_meth =
- {
- EVP_PKEY_DH,
- EVP_PKEY_DH,
- 0,
-
- "DH",
- "OpenSSL PKCS#3 DH method",
-
- dh_pub_decode,
- dh_pub_encode,
- dh_pub_cmp,
- dh_public_print,
-
- dh_priv_decode,
- dh_priv_encode,
- dh_private_print,
-
- int_dh_size,
- dh_bits,
-
- dh_param_decode,
- dh_param_encode,
- dh_missing_parameters,
- dh_copy_parameters,
- dh_cmp_parameters,
- dh_param_print,
- 0,
-
- int_dh_free,
- 0
- };
+const EVP_PKEY_ASN1_METHOD dh_asn1_meth = {
+ .pkey_id = EVP_PKEY_DH,
+ .pkey_base_id = EVP_PKEY_DH,
+
+ .pem_str = "DH",
+ .info = "OpenSSL PKCS#3 DH method",
+
+ .pub_decode = dh_pub_decode,
+ .pub_encode = dh_pub_encode,
+ .pub_cmp = dh_pub_cmp,
+ .pub_print = dh_public_print,
+
+ .priv_decode = dh_priv_decode,
+ .priv_encode = dh_priv_encode,
+ .priv_print = dh_private_print,
+
+ .pkey_size = int_dh_size,
+ .pkey_bits = dh_bits,
+
+ .param_decode = dh_param_decode,
+ .param_encode = dh_param_encode,
+ .param_missing = dh_missing_parameters,
+ .param_copy = dh_copy_parameters,
+ .param_cmp = dh_cmp_parameters,
+ .param_print = dh_param_print,
+
+ .pkey_free = int_dh_free,
+};
}
static DH_METHOD dh_ossl = {
-"OpenSSL DH Method",
-generate_key,
-compute_key,
-dh_bn_mod_exp,
-dh_init,
-dh_finish,
-0,
-NULL,
-NULL
+ .name = "OpenSSL DH Method",
+ .generate_key = generate_key,
+ .compute_key = compute_key,
+ .bn_mod_exp = dh_bn_mod_exp,
+ .init = dh_init,
+ .finish = dh_finish,
};
const DH_METHOD *DH_OpenSSL(void)
return 1;
}
-const EVP_PKEY_METHOD dh_pkey_meth =
- {
- EVP_PKEY_DH,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_dh_init,
- pkey_dh_copy,
- pkey_dh_cleanup,
-
- 0,
- pkey_dh_paramgen,
-
- 0,
- pkey_dh_keygen,
-
- 0,
- 0,
-
- 0,
- 0,
-
- 0,0,
-
- 0,0,0,0,
+const EVP_PKEY_METHOD dh_pkey_meth = {
+ .pkey_id = EVP_PKEY_DH,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
- 0,0,
+ .init = pkey_dh_init,
+ .copy = pkey_dh_copy,
+ .cleanup = pkey_dh_cleanup,
- 0,0,
+ .paramgen = pkey_dh_paramgen,
- 0,
- pkey_dh_derive,
+ .keygen = pkey_dh_keygen,
- pkey_dh_ctrl,
- pkey_dh_ctrl_str
+ .derive = pkey_dh_derive,
- };
+ .ctrl = pkey_dh_ctrl,
+ .ctrl_str = pkey_dh_ctrl_str
+};
/* NB these are sorted in pkey_id order, lowest first */
-const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] =
+const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = {
{
+ .pkey_id = EVP_PKEY_DSA2,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA2,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
-
- {
- EVP_PKEY_DSA1,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
-
- {
- EVP_PKEY_DSA4,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
+ {
+ .pkey_id = EVP_PKEY_DSA1,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA3,
- EVP_PKEY_DSA,
- ASN1_PKEY_ALIAS
- },
+ {
+ .pkey_id = EVP_PKEY_DSA4,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
- {
- EVP_PKEY_DSA,
- EVP_PKEY_DSA,
- 0,
-
- "DSA",
- "OpenSSL DSA method",
-
- dsa_pub_decode,
- dsa_pub_encode,
- dsa_pub_cmp,
- dsa_pub_print,
-
- dsa_priv_decode,
- dsa_priv_encode,
- dsa_priv_print,
-
- int_dsa_size,
- dsa_bits,
-
- dsa_param_decode,
- dsa_param_encode,
- dsa_missing_parameters,
- dsa_copy_parameters,
- dsa_cmp_parameters,
- dsa_param_print,
- dsa_sig_print,
-
- int_dsa_free,
- dsa_pkey_ctrl,
- old_dsa_priv_decode,
- old_dsa_priv_encode
- }
- };
+ {
+ .pkey_id = EVP_PKEY_DSA3,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ },
+ {
+ .pkey_id = EVP_PKEY_DSA,
+ .pkey_base_id = EVP_PKEY_DSA,
+
+ .pem_str = "DSA",
+ .info = "OpenSSL DSA method",
+
+ .pub_decode = dsa_pub_decode,
+ .pub_encode = dsa_pub_encode,
+ .pub_cmp = dsa_pub_cmp,
+ .pub_print = dsa_pub_print,
+
+ .priv_decode = dsa_priv_decode,
+ .priv_encode = dsa_priv_encode,
+ .priv_print = dsa_priv_print,
+
+ .pkey_size = int_dsa_size,
+ .pkey_bits = dsa_bits,
+
+ .param_decode = dsa_param_decode,
+ .param_encode = dsa_param_encode,
+ .param_missing = dsa_missing_parameters,
+ .param_copy = dsa_copy_parameters,
+ .param_cmp = dsa_cmp_parameters,
+ .param_print = dsa_param_print,
+ .sig_print = dsa_sig_print,
+
+ .pkey_free = int_dsa_free,
+ .pkey_ctrl = dsa_pkey_ctrl,
+ .old_priv_decode = old_dsa_priv_decode,
+ .old_priv_encode = old_dsa_priv_encode
+ }
+};
static int dsa_finish(DSA *dsa);
static DSA_METHOD openssl_dsa_meth = {
-"OpenSSL DSA method",
-dsa_do_sign,
-dsa_sign_setup,
-dsa_do_verify,
-NULL, /* dsa_mod_exp, */
-NULL, /* dsa_bn_mod_exp, */
-dsa_init,
-dsa_finish,
-0,
-NULL,
-NULL,
-NULL
+ .name = "OpenSSL DSA method",
+ .dsa_do_sign = dsa_do_sign,
+ .dsa_sign_setup = dsa_sign_setup,
+ .dsa_do_verify = dsa_do_verify,
+ .init = dsa_init,
+ .finish = dsa_finish
};
/* These macro wrappers replace attempts to use the dsa_mod_exp() and
return DSA_generate_key(pkey->pkey.dsa);
}
-const EVP_PKEY_METHOD dsa_pkey_meth =
- {
- EVP_PKEY_DSA,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_dsa_init,
- pkey_dsa_copy,
- pkey_dsa_cleanup,
-
- 0,
- pkey_dsa_paramgen,
-
- 0,
- pkey_dsa_keygen,
-
- 0,
- pkey_dsa_sign,
-
- 0,
- pkey_dsa_verify,
-
- 0,0,
-
- 0,0,0,0,
+const EVP_PKEY_METHOD dsa_pkey_meth = {
+ .pkey_id = EVP_PKEY_DSA,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
- 0,0,
+ .init = pkey_dsa_init,
+ .copy = pkey_dsa_copy,
+ .cleanup = pkey_dsa_cleanup,
- 0,0,
+ .paramgen = pkey_dsa_paramgen,
- 0,0,
+ .keygen = pkey_dsa_keygen,
- pkey_dsa_ctrl,
- pkey_dsa_ctrl_str
+ .sign = pkey_dsa_sign,
+ .verify = pkey_dsa_verify,
- };
+ .ctrl = pkey_dsa_ctrl,
+ .ctrl_str = pkey_dsa_ctrl_str
+};
static void *dlfcn_globallookup(const char *name);
static DSO_METHOD dso_meth_dlfcn = {
- "OpenSSL 'dlfcn' shared library method",
- dlfcn_load,
- dlfcn_unload,
- dlfcn_bind_var,
- dlfcn_bind_func,
-/* For now, "unbind" doesn't exist */
-#if 0
- NULL, /* unbind_var */
- NULL, /* unbind_func */
-#endif
- NULL, /* ctrl */
- dlfcn_name_converter,
- dlfcn_merger,
- NULL, /* init */
- NULL, /* finish */
- dlfcn_pathbyaddr,
- dlfcn_globallookup
+ .name = "OpenSSL 'dlfcn' shared library method",
+ .dso_load = dlfcn_load,
+ .dso_unload = dlfcn_unload,
+ .dso_bind_var = dlfcn_bind_var,
+ .dso_bind_func = dlfcn_bind_func,
+ .dso_name_converter = dlfcn_name_converter,
+ .dso_merger = dlfcn_merger,
+ .pathbyaddr = dlfcn_pathbyaddr,
+ .globallookup = dlfcn_globallookup
};
DSO_METHOD *
#include <openssl/dso.h>
static DSO_METHOD dso_meth_null = {
- "NULL shared library method",
- NULL, /* load */
- NULL, /* unload */
- NULL, /* bind_var */
- NULL, /* bind_func */
-/* For now, "unbind" doesn't exist */
-#if 0
- NULL, /* unbind_var */
- NULL, /* unbind_func */
-#endif
- NULL, /* ctrl */
- NULL, /* dso_name_converter */
- NULL, /* dso_merger */
- NULL, /* init */
- NULL, /* finish */
- NULL, /* pathbyaddr */
- NULL /* globallookup */
+ .name = "NULL shared library method"
};
DSO_METHOD *
#ifndef OPENSSL_NO_EC2M
-const EC_METHOD *EC_GF2m_simple_method(void)
- {
+const EC_METHOD *
+EC_GF2m_simple_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_characteristic_two_field,
- ec_GF2m_simple_group_init,
- ec_GF2m_simple_group_finish,
- ec_GF2m_simple_group_clear_finish,
- ec_GF2m_simple_group_copy,
- ec_GF2m_simple_group_set_curve,
- ec_GF2m_simple_group_get_curve,
- ec_GF2m_simple_group_get_degree,
- ec_GF2m_simple_group_check_discriminant,
- ec_GF2m_simple_point_init,
- ec_GF2m_simple_point_finish,
- ec_GF2m_simple_point_clear_finish,
- ec_GF2m_simple_point_copy,
- ec_GF2m_simple_point_set_to_infinity,
- 0 /* set_Jprojective_coordinates_GFp */,
- 0 /* get_Jprojective_coordinates_GFp */,
- ec_GF2m_simple_point_set_affine_coordinates,
- ec_GF2m_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GF2m_simple_add,
- ec_GF2m_simple_dbl,
- ec_GF2m_simple_invert,
- ec_GF2m_simple_is_at_infinity,
- ec_GF2m_simple_is_on_curve,
- ec_GF2m_simple_cmp,
- ec_GF2m_simple_make_affine,
- ec_GF2m_simple_points_make_affine,
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_characteristic_two_field,
+ .group_init = ec_GF2m_simple_group_init,
+ .group_finish = ec_GF2m_simple_group_finish,
+ .group_clear_finish = ec_GF2m_simple_group_clear_finish,
+ .group_copy = ec_GF2m_simple_group_copy,
+ .group_set_curve = ec_GF2m_simple_group_set_curve,
+ .group_get_curve = ec_GF2m_simple_group_get_curve,
+ .group_get_degree = ec_GF2m_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GF2m_simple_group_check_discriminant,
+ .point_init = ec_GF2m_simple_point_init,
+ .point_finish = ec_GF2m_simple_point_finish,
+ .point_clear_finish = ec_GF2m_simple_point_clear_finish,
+ .point_copy = ec_GF2m_simple_point_copy,
+ .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity,
+ .point_set_affine_coordinates =
+ ec_GF2m_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GF2m_simple_point_get_affine_coordinates,
+ .add = ec_GF2m_simple_add,
+ .dbl = ec_GF2m_simple_dbl,
+ .invert = ec_GF2m_simple_invert,
+ .is_at_infinity = ec_GF2m_simple_is_at_infinity,
+ .is_on_curve = ec_GF2m_simple_is_on_curve,
+ .point_cmp = ec_GF2m_simple_cmp,
+ .make_affine = ec_GF2m_simple_make_affine,
+ .points_make_affine = ec_GF2m_simple_points_make_affine,
/* the following three method functions are defined in ec2_mult.c */
- ec_GF2m_simple_mul,
- ec_GF2m_precompute_mult,
- ec_GF2m_have_precompute_mult,
+ .mul = ec_GF2m_simple_mul,
+ .precompute_mult = ec_GF2m_precompute_mult,
+ .have_precompute_mult = ec_GF2m_have_precompute_mult,
- ec_GF2m_simple_field_mul,
- ec_GF2m_simple_field_sqr,
- ec_GF2m_simple_field_div,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .field_mul = ec_GF2m_simple_field_mul,
+ .field_sqr = ec_GF2m_simple_field_sqr,
+ .field_div = ec_GF2m_simple_field_div,
+ };
return &ret;
- }
+}
/* Initialize a GF(2^m)-based EC_GROUP structure.
}
-const EVP_PKEY_ASN1_METHOD eckey_asn1_meth =
- {
- EVP_PKEY_EC,
- EVP_PKEY_EC,
- 0,
- "EC",
- "OpenSSL EC algorithm",
-
- eckey_pub_decode,
- eckey_pub_encode,
- eckey_pub_cmp,
- eckey_pub_print,
-
- eckey_priv_decode,
- eckey_priv_encode,
- eckey_priv_print,
-
- int_ec_size,
- ec_bits,
-
- eckey_param_decode,
- eckey_param_encode,
- ec_missing_parameters,
- ec_copy_parameters,
- ec_cmp_parameters,
- eckey_param_print,
- 0,
-
- int_ec_free,
- ec_pkey_ctrl,
- old_ec_priv_decode,
- old_ec_priv_encode
- };
+const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
+ .pkey_id = EVP_PKEY_EC,
+ .pkey_base_id = EVP_PKEY_EC,
+
+ .pem_str = "EC",
+ .info = "OpenSSL EC algorithm",
+
+ .pub_decode = eckey_pub_decode,
+ .pub_encode = eckey_pub_encode,
+ .pub_cmp = eckey_pub_cmp,
+ .pub_print = eckey_pub_print,
+
+ .priv_decode = eckey_priv_decode,
+ .priv_encode = eckey_priv_encode,
+ .priv_print = eckey_priv_print,
+
+ .pkey_size = int_ec_size,
+ .pkey_bits = ec_bits,
+
+ .param_decode = eckey_param_decode,
+ .param_encode = eckey_param_encode,
+ .param_missing = ec_missing_parameters,
+ .param_copy = ec_copy_parameters,
+ .param_cmp = ec_cmp_parameters,
+ .param_print = eckey_param_print,
+
+ .pkey_free = int_ec_free,
+ .pkey_ctrl = ec_pkey_ctrl,
+ .old_priv_decode = old_ec_priv_decode,
+ .old_priv_encode = old_ec_priv_encode
+};
return EC_KEY_generate_key(pkey->pkey.ec);
}
-const EVP_PKEY_METHOD ec_pkey_meth =
- {
- EVP_PKEY_EC,
- 0,
- pkey_ec_init,
- pkey_ec_copy,
- pkey_ec_cleanup,
-
- 0,
- pkey_ec_paramgen,
-
- 0,
- pkey_ec_keygen,
-
- 0,
- pkey_ec_sign,
-
- 0,
- pkey_ec_verify,
+const EVP_PKEY_METHOD ec_pkey_meth = {
+ .pkey_id = EVP_PKEY_EC,
- 0,0,
+ .init = pkey_ec_init,
+ .copy = pkey_ec_copy,
+ .cleanup = pkey_ec_cleanup,
- 0,0,0,0,
+ .paramgen = pkey_ec_paramgen,
- 0,0,
+ .keygen = pkey_ec_keygen,
- 0,0,
+ .sign = pkey_ec_sign,
- 0,
- pkey_ec_derive,
+ .verify = pkey_ec_verify,
- pkey_ec_ctrl,
- pkey_ec_ctrl_str
+ .derive = pkey_ec_derive,
- };
+ .ctrl = pkey_ec_ctrl,
+ .ctrl_str = pkey_ec_ctrl_str
+};
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_mont_method(void)
- {
+const EC_METHOD *
+EC_GFp_mont_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_mont_group_init,
- ec_GFp_mont_group_finish,
- ec_GFp_mont_group_clear_finish,
- ec_GFp_mont_group_copy,
- ec_GFp_mont_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_mont_field_mul,
- ec_GFp_mont_field_sqr,
- 0 /* field_div */,
- ec_GFp_mont_field_encode,
- ec_GFp_mont_field_decode,
- ec_GFp_mont_field_set_to_one };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_mont_group_init,
+ .group_finish = ec_GFp_mont_group_finish,
+ .group_clear_finish = ec_GFp_mont_group_clear_finish,
+ .group_copy = ec_GFp_mont_group_copy,
+ .group_set_curve = ec_GFp_mont_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_mont_field_mul,
+ .field_sqr = ec_GFp_mont_field_sqr,
+ .field_encode = ec_GFp_mont_field_encode,
+ .field_decode = ec_GFp_mont_field_decode,
+ .field_set_to_one = ec_GFp_mont_field_set_to_one
+ };
return &ret;
- }
+}
int ec_GFp_mont_group_init(EC_GROUP *group)
#include <openssl/obj_mac.h>
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_nist_method(void)
- {
+const EC_METHOD *
+EC_GFp_nist_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_simple_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nist_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_simple_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nist_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
{
int references;
} NISTP224_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp224_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp224_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp224_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp224_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp224_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp224_points_mul,
- ec_GFp_nistp224_precompute_mult,
- ec_GFp_nistp224_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp224_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp224_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp224_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp224_points_mul,
+ .precompute_mult = ec_GFp_nistp224_precompute_mult,
+ .have_precompute_mult = ec_GFp_nistp224_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/* Helper functions to convert field elements to/from internal representation */
static void bin28_to_felem(felem out, const u8 in[28])
int references;
} NISTP256_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp256_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp256_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp256_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp256_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp256_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp256_points_mul,
- ec_GFp_nistp256_precompute_mult,
- ec_GFp_nistp256_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp256_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp256_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp256_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp256_points_mul,
+ .precompute_mult = ec_GFp_nistp256_precompute_mult,
+ .have_precompute_mult = ec_GFp_nistp256_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/******************************************************************************/
/* FUNCTIONS TO MANAGE PRECOMPUTATION
int references;
} NISTP521_PRE_COMP;
-const EC_METHOD *EC_GFp_nistp521_method(void)
- {
+const EC_METHOD *
+EC_GFp_nistp521_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_nistp521_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_nist_group_copy,
- ec_GFp_nistp521_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_nistp521_point_get_affine_coordinates,
- 0 /* point_set_compressed_coordinates */,
- 0 /* point2oct */,
- 0 /* oct2point */,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- ec_GFp_nistp521_points_mul,
- ec_GFp_nistp521_precompute_mult,
- ec_GFp_nistp521_have_precompute_mult,
- ec_GFp_nist_field_mul,
- ec_GFp_nist_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_nistp521_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_nist_group_copy,
+ .group_set_curve = ec_GFp_nistp521_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_nistp521_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .mul = ec_GFp_nistp521_points_mul,
+ .precompute_mult = ec_GFp_nistp521_precompute_mult,
+ .have_precompulte_mult = ec_GFp_nistp521_have_precompute_mult,
+ .field_mul = ec_GFp_nist_field_mul,
+ .field_sqr = ec_GFp_nist_field_sqr
+ };
return &ret;
- }
+}
/******************************************************************************/
#include "ec_lcl.h"
-const EC_METHOD *EC_GFp_simple_method(void)
- {
+const EC_METHOD *
+EC_GFp_simple_method(void)
+{
static const EC_METHOD ret = {
- EC_FLAGS_DEFAULT_OCT,
- NID_X9_62_prime_field,
- ec_GFp_simple_group_init,
- ec_GFp_simple_group_finish,
- ec_GFp_simple_group_clear_finish,
- ec_GFp_simple_group_copy,
- ec_GFp_simple_group_set_curve,
- ec_GFp_simple_group_get_curve,
- ec_GFp_simple_group_get_degree,
- ec_GFp_simple_group_check_discriminant,
- ec_GFp_simple_point_init,
- ec_GFp_simple_point_finish,
- ec_GFp_simple_point_clear_finish,
- ec_GFp_simple_point_copy,
- ec_GFp_simple_point_set_to_infinity,
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
- ec_GFp_simple_point_set_affine_coordinates,
- ec_GFp_simple_point_get_affine_coordinates,
- 0,0,0,
- ec_GFp_simple_add,
- ec_GFp_simple_dbl,
- ec_GFp_simple_invert,
- ec_GFp_simple_is_at_infinity,
- ec_GFp_simple_is_on_curve,
- ec_GFp_simple_cmp,
- ec_GFp_simple_make_affine,
- ec_GFp_simple_points_make_affine,
- 0 /* mul */,
- 0 /* precompute_mult */,
- 0 /* have_precompute_mult */,
- ec_GFp_simple_field_mul,
- ec_GFp_simple_field_sqr,
- 0 /* field_div */,
- 0 /* field_encode */,
- 0 /* field_decode */,
- 0 /* field_set_to_one */ };
+ .flags = EC_FLAGS_DEFAULT_OCT,
+ .field_type = NID_X9_62_prime_field,
+ .group_init = ec_GFp_simple_group_init,
+ .group_finish = ec_GFp_simple_group_finish,
+ .group_clear_finish = ec_GFp_simple_group_clear_finish,
+ .group_copy = ec_GFp_simple_group_copy,
+ .group_set_curve = ec_GFp_simple_group_set_curve,
+ .group_get_curve = ec_GFp_simple_group_get_curve,
+ .group_get_degree = ec_GFp_simple_group_get_degree,
+ .group_check_discriminant =
+ ec_GFp_simple_group_check_discriminant,
+ .point_init = ec_GFp_simple_point_init,
+ .point_finish = ec_GFp_simple_point_finish,
+ .point_clear_finish = ec_GFp_simple_point_clear_finish,
+ .point_copy = ec_GFp_simple_point_copy,
+ .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
+ .point_set_Jprojective_coordinates_GFp =
+ ec_GFp_simple_set_Jprojective_coordinates_GFp,
+ .point_get_Jprojective_coordinates_GFp =
+ ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_affine_coordinates =
+ ec_GFp_simple_point_set_affine_coordinates,
+ .point_get_affine_coordinates =
+ ec_GFp_simple_point_get_affine_coordinates,
+ .add = ec_GFp_simple_add,
+ .dbl = ec_GFp_simple_dbl,
+ .invert = ec_GFp_simple_invert,
+ .is_at_infinity = ec_GFp_simple_is_at_infinity,
+ .is_on_curve = ec_GFp_simple_is_on_curve,
+ .point_cmp = ec_GFp_simple_cmp,
+ .make_affine = ec_GFp_simple_make_affine,
+ .points_make_affine = ec_GFp_simple_points_make_affine,
+ .field_mul = ec_GFp_simple_field_mul,
+ .field_sqr = ec_GFp_simple_field_sqr
+ };
return &ret;
- }
+}
/* Most method functions in this file are designed to work with
void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));
static ECDH_METHOD openssl_ecdh_meth = {
- "OpenSSL ECDH method",
- ecdh_compute_key,
-#if 0
- NULL, /* init */
- NULL, /* finish */
-#endif
- 0, /* flags */
- NULL /* app_data */
+ .name = "OpenSSL ECDH method",
+ .compute_key = ecdh_compute_key
};
const ECDH_METHOD *ECDH_OpenSSL(void)
const ECDSA_SIG *sig, EC_KEY *eckey);
static ECDSA_METHOD openssl_ecdsa_meth = {
- "OpenSSL ECDSA method",
- ecdsa_do_sign,
- ecdsa_sign_setup,
- ecdsa_do_verify,
-#if 0
- NULL, /* init */
- NULL, /* finish */
-#endif
- 0, /* flags */
- NULL /* app_data */
+ .name = "OpenSSL ECDSA method",
+ .ecdsa_do_sign = ecdsa_do_sign,
+ .ecdsa_sign_setup = ecdsa_sign_setup,
+ .ecdsa_do_verify = ecdsa_do_verify
};
const ECDSA_METHOD *ECDSA_OpenSSL(void)
/* Prepare structure for registration */
static RAND_METHOD padlock_rand = {
- NULL, /* seed */
- padlock_rand_bytes, /* bytes */
- NULL, /* cleanup */
- NULL, /* add */
- padlock_rand_bytes, /* pseudorand */
- padlock_rand_status, /* rand status */
+ .bytes = padlock_rand_bytes,
+ .pseudorand = padlock_rand_bytes,
+ .status = padlock_rand_status
};
#else /* !COMPILE_HW_PADLOCK */
static int random_status (void)
{ return 1; }
-static RAND_METHOD rdrand_meth =
- {
- NULL, /* seed */
- get_random_bytes,
- NULL, /* cleanup */
- NULL, /* add */
- get_random_bytes,
- random_status,
- };
+static RAND_METHOD rdrand_meth = {
+ .bytes = get_random_bytes,
+ .pseudorand = get_random_bytes,
+ .status = random_status
+};
static int rdrand_init(ENGINE *e)
{ return 1; }
#ifndef OPENSSL_NO_RSA
/* Our internal RSA_METHOD that we provide pointers to */
-static RSA_METHOD e_rsax_rsa =
- {
- "Intel RSA-X method",
- NULL,
- NULL,
- NULL,
- NULL,
- e_rsax_rsa_mod_exp,
- NULL,
- NULL,
- e_rsax_rsa_finish,
- RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
- NULL,
- NULL,
- NULL
- };
+static RSA_METHOD e_rsax_rsa = {
+ .name = "Intel RSA-X method",
+ .rsa_mod_exp = e_rsax_rsa_mod_exp,
+ .finish = e_rsax_rsa_finish,
+ .flags = RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE,
+};
#endif
/* Constants used when creating the ENGINE */
}
static RSA_METHOD cryptodev_rsa = {
- "cryptodev RSA method",
- NULL, /* rsa_pub_enc */
- NULL, /* rsa_pub_dec */
- NULL, /* rsa_priv_enc */
- NULL, /* rsa_priv_dec */
- NULL,
- NULL,
- NULL, /* init */
- NULL, /* finish */
- 0, /* flags */
- NULL, /* app_data */
- NULL, /* rsa_sign */
- NULL /* rsa_verify */
+ .name = "cryptodev RSA method"
};
static int
}
static DSA_METHOD cryptodev_dsa = {
- "cryptodev DSA method",
- NULL,
- NULL, /* dsa_sign_setup */
- NULL,
- NULL, /* dsa_mod_exp */
- NULL,
- NULL, /* init */
- NULL, /* finish */
- 0, /* flags */
- NULL /* app_data */
+ .name = "cryptodev DSA method"
};
static int
}
static DH_METHOD cryptodev_dh = {
- "cryptodev DH method",
- NULL, /* cryptodev_dh_generate_key */
- NULL,
- NULL,
- NULL,
- NULL,
- 0, /* flags */
- NULL /* app_data */
+ .name = "cryptodev DH method"
};
/*
char tmp[B64_BLOCK_SIZE];
} BIO_B64_CTX;
-static BIO_METHOD methods_b64=
- {
- BIO_TYPE_BASE64,"base64 encoding",
- b64_write,
- b64_read,
- b64_puts,
- NULL, /* b64_gets, */
- b64_ctrl,
- b64_new,
- b64_free,
- b64_callback_ctrl,
- };
+static BIO_METHOD methods_b64= {
+ .type = BIO_TYPE_BASE64,
+ .name = "base64 encoding",
+ .bwrite = b64_write,
+ .bread = b64_read,
+ .bputs = b64_puts,
+ .ctrl = b64_ctrl,
+ .create = b64_new,
+ .destroy = b64_free,
+ .callback_ctrl = b64_callback_ctrl
+};
BIO_METHOD *BIO_f_base64(void)
{
char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2];
} BIO_ENC_CTX;
-static BIO_METHOD methods_enc=
- {
- BIO_TYPE_CIPHER,"cipher",
- enc_write,
- enc_read,
- NULL, /* enc_puts, */
- NULL, /* enc_gets, */
- enc_ctrl,
- enc_new,
- enc_free,
- enc_callback_ctrl,
- };
+static BIO_METHOD methods_enc= {
+ .type = BIO_TYPE_CIPHER,
+ .name = "cipher",
+ .bwrite = enc_write,
+ .bread = enc_read,
+ .ctrl = enc_ctrl,
+ .create = enc_new,
+ .destroy = enc_free,
+ .callback_ctrl = enc_callback_ctrl
+};
BIO_METHOD *BIO_f_cipher(void)
{
static int md_free(BIO *data);
static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
-static BIO_METHOD methods_md=
- {
- BIO_TYPE_MD,"message digest",
- md_write,
- md_read,
- NULL, /* md_puts, */
- md_gets,
- md_ctrl,
- md_new,
- md_free,
- md_callback_ctrl,
- };
+static BIO_METHOD methods_md = {
+ .type = BIO_TYPE_MD,
+ .name = "message digest",
+ .bwrite = md_write,
+ .bread = md_read,
+ .bgets = md_gets,
+ .ctrl = md_ctrl,
+ .create = md_new,
+ .destroy = md_free,
+ .callback_ctrl = md_callback_ctrl
+};
BIO_METHOD *BIO_f_md(void)
{
unsigned char buf[IOBS];
} BIO_OK_CTX;
-static BIO_METHOD methods_ok=
- {
- BIO_TYPE_CIPHER,"reliable",
- ok_write,
- ok_read,
- NULL, /* ok_puts, */
- NULL, /* ok_gets, */
- ok_ctrl,
- ok_new,
- ok_free,
- ok_callback_ctrl,
- };
+static BIO_METHOD methods_ok = {
+ .type = BIO_TYPE_CIPHER,
+ .name = "reliable",
+ .bwrite = ok_write,
+ .bread = ok_read,
+ .ctrl = ok_ctrl,
+ .create = ok_new,
+ .destroy = ok_free,
+ .callback_ctrl = ok_callback_ctrl
+};
BIO_METHOD *BIO_f_reliable(void)
{
#endif
-const EVP_PKEY_ASN1_METHOD hmac_asn1_meth =
- {
- EVP_PKEY_HMAC,
- EVP_PKEY_HMAC,
- 0,
-
- "HMAC",
- "OpenSSL HMAC method",
-
- 0,0,0,0,
+const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
+ .pkey_id = EVP_PKEY_HMAC,
+ .pkey_base_id = EVP_PKEY_HMAC,
- 0,0,0,
+ .pem_str = "HMAC",
+ .info = "OpenSSL HMAC method",
- hmac_size,
- 0,
- 0,0,0,0,0,0,0,
+ .pkey_size = hmac_size,
- hmac_key_free,
- hmac_pkey_ctrl,
+ .pkey_free = hmac_key_free,
+ .pkey_ctrl = hmac_pkey_ctrl,
#ifdef HMAC_TEST_PRIVATE_KEY_FORMAT
- old_hmac_decode,
- old_hmac_encode
-#else
- 0,0
+ .old_priv_decode = old_hmac_decode,
+ .old_priv_encode = old_hmac_encode
#endif
};
return -2;
}
-const EVP_PKEY_METHOD hmac_pkey_meth =
- {
- EVP_PKEY_HMAC,
- 0,
- pkey_hmac_init,
- pkey_hmac_copy,
- pkey_hmac_cleanup,
-
- 0, 0,
-
- 0,
- pkey_hmac_keygen,
-
- 0, 0,
-
- 0, 0,
-
- 0,0,
-
- hmac_signctx_init,
- hmac_signctx,
-
- 0,0,
-
- 0,0,
+const EVP_PKEY_METHOD hmac_pkey_meth = {
+ .pkey_id = EVP_PKEY_HMAC,
- 0,0,
+ .init = pkey_hmac_init,
+ .copy = pkey_hmac_copy,
+ .cleanup = pkey_hmac_cleanup,
- 0,0,
+ .keygen = pkey_hmac_keygen,
- pkey_hmac_ctrl,
- pkey_hmac_ctrl_str
+ .signctx_init = hmac_signctx_init,
+ .signctx = hmac_signctx,
- };
+ .ctrl = pkey_hmac_ctrl,
+ .ctrl_str = pkey_hmac_ctrl_str
+};
unsigned char buf[BER_BUF_SIZE];
} BIO_BER_CTX;
-static BIO_METHOD methods_ber=
- {
- BIO_TYPE_CIPHER,"cipher",
- ber_write,
- ber_read,
- NULL, /* ber_puts, */
- NULL, /* ber_gets, */
- ber_ctrl,
- ber_new,
- ber_free,
- ber_callback_ctrl,
- };
+static BIO_METHOD methods_ber = {
+ .type = BIO_TYPE_CIPHER,
+ .name = "cipher",
+ .bwrite = ber_write,
+ .bread = ber_read,
+ .ctrl = ber_ctrl,
+ .create = ber_new,
+ .destroy = ber_free,
+ .callback_ctrl = ber_callback_ctrl
+};
BIO_METHOD *BIO_f_ber(void)
{
return 2;
}
-const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] =
+const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
{
- {
- EVP_PKEY_RSA,
- EVP_PKEY_RSA,
- ASN1_PKEY_SIGPARAM_NULL,
+ .pkey_id = EVP_PKEY_RSA,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
- "RSA",
- "OpenSSL RSA method",
+ .pem_str = "RSA",
+ .info = "OpenSSL RSA method",
- rsa_pub_decode,
- rsa_pub_encode,
- rsa_pub_cmp,
- rsa_pub_print,
+ .pub_decode = rsa_pub_decode,
+ .pub_encode = rsa_pub_encode,
+ .pub_cmp = rsa_pub_cmp,
+ .pub_print = rsa_pub_print,
- rsa_priv_decode,
- rsa_priv_encode,
- rsa_priv_print,
+ .priv_decode = rsa_priv_decode,
+ .priv_encode = rsa_priv_encode,
+ .priv_print = rsa_priv_print,
- int_rsa_size,
- rsa_bits,
+ .pkey_size = int_rsa_size,
+ .pkey_bits = rsa_bits,
- 0,0,0,0,0,0,
+ .sig_print = rsa_sig_print,
- rsa_sig_print,
- int_rsa_free,
- rsa_pkey_ctrl,
- old_rsa_priv_decode,
- old_rsa_priv_encode,
- rsa_item_verify,
- rsa_item_sign
- },
+ .pkey_free = int_rsa_free,
+ .pkey_ctrl = rsa_pkey_ctrl,
+ .old_priv_decode = old_rsa_priv_decode,
+ .old_priv_encode = old_rsa_priv_encode,
+ .item_verify = rsa_item_verify,
+ .item_sign = rsa_item_sign
+ },
- {
- EVP_PKEY_RSA2,
- EVP_PKEY_RSA,
- ASN1_PKEY_ALIAS
- }
- };
+ {
+ .pkey_id = EVP_PKEY_RSA2,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_ALIAS
+ }
+};
static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx);
static int RSA_eay_init(RSA *rsa);
static int RSA_eay_finish(RSA *rsa);
-static RSA_METHOD rsa_pkcs1_eay_meth={
- "Eric Young's PKCS#1 RSA",
- RSA_eay_public_encrypt,
- RSA_eay_public_decrypt, /* signature verification */
- RSA_eay_private_encrypt, /* signing */
- RSA_eay_private_decrypt,
- RSA_eay_mod_exp,
- BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
- RSA_eay_init,
- RSA_eay_finish,
- 0, /* flags */
- NULL,
- 0, /* rsa_sign */
- 0, /* rsa_verify */
- NULL /* rsa_keygen */
- };
+static RSA_METHOD rsa_pkcs1_eay_meth = {
+ .name = "Eric Young's PKCS#1 RSA",
+ .rsa_pub_enc = RSA_eay_public_encrypt,
+ .rsa_pub_dec = RSA_eay_public_decrypt, /* signature verification */
+ .rsa_priv_enc = RSA_eay_private_encrypt, /* signing */
+ .rsa_priv_dec = RSA_eay_private_decrypt,
+ .rsa_mod_exp = RSA_eay_mod_exp,
+ .bn_mod_exp = BN_mod_exp_mont, /* XXX probably we should not use Montgomery if e == 3 */
+ .init = RSA_eay_init,
+ .finish = RSA_eay_finish,
+};
const RSA_METHOD *RSA_PKCS1_SSLeay(void)
{
#endif
static int RSA_null_init(RSA *rsa);
static int RSA_null_finish(RSA *rsa);
-static RSA_METHOD rsa_null_meth={
- "Null RSA",
- RSA_null_public_encrypt,
- RSA_null_public_decrypt,
- RSA_null_private_encrypt,
- RSA_null_private_decrypt,
- NULL,
- NULL,
- RSA_null_init,
- RSA_null_finish,
- 0,
- NULL,
- NULL,
- NULL,
- NULL
- };
+static RSA_METHOD rsa_null_meth = {
+ .name = "Null RSA",
+ .rsa_pub_enc = RSA_null_public_encrypt,
+ .rsa_pub_dec = RSA_null_public_decrypt,
+ .rsa_priv_enc = RSA_null_private_encrypt,
+ .rsa_priv_dec = RSA_null_private_decrypt,
+ .init = RSA_null_init,
+ .finish = RSA_null_finish,
+};
const RSA_METHOD *RSA_null_method(void)
{
return ret;
}
-const EVP_PKEY_METHOD rsa_pkey_meth =
- {
- EVP_PKEY_RSA,
- EVP_PKEY_FLAG_AUTOARGLEN,
- pkey_rsa_init,
- pkey_rsa_copy,
- pkey_rsa_cleanup,
-
- 0,0,
-
- 0,
- pkey_rsa_keygen,
-
- 0,
- pkey_rsa_sign,
-
- 0,
- pkey_rsa_verify,
-
- 0,
- pkey_rsa_verifyrecover,
+const EVP_PKEY_METHOD rsa_pkey_meth = {
+ .pkey_id = EVP_PKEY_RSA,
+ .flags = EVP_PKEY_FLAG_AUTOARGLEN,
+ .init = pkey_rsa_init,
+ .copy = pkey_rsa_copy,
+ .cleanup = pkey_rsa_cleanup,
- 0,0,0,0,
+ .keygen = pkey_rsa_keygen,
- 0,
- pkey_rsa_encrypt,
+ .sign = pkey_rsa_sign,
- 0,
- pkey_rsa_decrypt,
+ .verify = pkey_rsa_verify,
- 0,0,
+ .verify_recover = pkey_rsa_verifyrecover,
- pkey_rsa_ctrl,
- pkey_rsa_ctrl_str
+ .encrypt = pkey_rsa_encrypt,
+ .decrypt = pkey_rsa_decrypt,
- };
+ .ctrl = pkey_rsa_ctrl,
+ .ctrl_str = pkey_rsa_ctrl_str
+};
OPENSSL_ITEM parameters[]);
static int mem_ctrl(STORE *s, int cmd, long l, void *p, void (*f)(void));
-static STORE_METHOD store_memory =
- {
- "OpenSSL memory store interface",
- mem_init,
- mem_clean,
- mem_generate,
- mem_get,
- mem_store,
- mem_modify,
- NULL, /* revoke */
- mem_delete,
- mem_list_start,
- mem_list_next,
- mem_list_end,
- mem_list_endp,
- NULL, /* update */
- mem_lock,
- mem_unlock,
- mem_ctrl
+static STORE_METHOD store_memory = {
+ .name = "OpenSSL memory store interface",
+ .init = mem_init,
+ .clean = mem_clean,
+ .generate_object = mem_generate,
+ .get_object = mem_get,
+ .store_object = mem_store,
+ .modify_object = mem_modify,
+ .delete_object = mem_delete,
+ .list_object_start = mem_list_start,
+ .list_object_next = mem_list_next,
+ .list_object_end = mem_list_end,
+ .list_object_endp = mem_list_endp,
+ .lock_store = mem_lock,
+ .unlock_store = mem_unlock,
+ .ctrl = mem_ctrl
};
const STORE_METHOD *STORE_Memory(void)
static int close_console(UI *ui);
static UI_METHOD ui_openssl = {
- "OpenSSL default user interface",
- open_console,
- write_string,
- NULL, /* No flusher is needed for command lines */
- read_string,
- close_console,
- NULL
+ .name = "OpenSSL default user interface",
+ .ui_open_session = open_console,
+ .ui_write_string = write_string,
+ .ui_read_string = read_string,
+ .ui_close_session = close_console,
};
/* The method with all the built-in thingies */