-/* $OpenBSD: dsa_ameth.c,v 1.55 2023/08/12 07:59:48 tb Exp $ */
+/* $OpenBSD: dsa_ameth.c,v 1.56 2024/01/04 16:41:56 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
}
}
-/* NB these are sorted in pkey_id order, lowest first */
-
-const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[] = {
- {
- .pkey_id = EVP_PKEY_DSA2,
- .pkey_base_id = EVP_PKEY_DSA,
- .pkey_flags = ASN1_PKEY_ALIAS
- },
-
- {
- .pkey_id = EVP_PKEY_DSA1,
- .pkey_base_id = EVP_PKEY_DSA,
- .pkey_flags = ASN1_PKEY_ALIAS
- },
-
- {
- .pkey_id = EVP_PKEY_DSA4,
- .pkey_base_id = EVP_PKEY_DSA,
- .pkey_flags = ASN1_PKEY_ALIAS
- },
-
- {
- .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 = dsa_size,
- .pkey_bits = dsa_bits,
- .pkey_security_bits = dsa_security_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 = dsa_free,
- .pkey_ctrl = dsa_pkey_ctrl,
- .old_priv_decode = old_dsa_priv_decode,
- .old_priv_encode = old_dsa_priv_encode
- }
+const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = {
+ .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 = dsa_size,
+ .pkey_bits = dsa_bits,
+ .pkey_security_bits = dsa_security_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 = dsa_free,
+ .pkey_ctrl = dsa_pkey_ctrl,
+ .old_priv_decode = old_dsa_priv_decode,
+ .old_priv_encode = old_dsa_priv_encode
+};
+
+const EVP_PKEY_ASN1_METHOD dsa1_asn1_meth = {
+ .pkey_id = EVP_PKEY_DSA1,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS,
+};
+
+const EVP_PKEY_ASN1_METHOD dsa2_asn1_meth = {
+ .pkey_id = EVP_PKEY_DSA2,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS,
+};
+
+const EVP_PKEY_ASN1_METHOD dsa3_asn1_meth = {
+ .pkey_id = EVP_PKEY_DSA3,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS,
+};
+
+const EVP_PKEY_ASN1_METHOD dsa4_asn1_meth = {
+ .pkey_id = EVP_PKEY_DSA4,
+ .pkey_base_id = EVP_PKEY_DSA,
+ .pkey_flags = ASN1_PKEY_ALIAS,
};
-/* $OpenBSD: p_lib.c,v 1.52 2024/01/01 15:23:00 tb Exp $ */
+/* $OpenBSD: p_lib.c,v 1.53 2024/01/04 16:41:56 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth;
-extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[];
+extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD dsa1_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD dsa2_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD dsa3_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD dsa4_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD gostimit_asn1_meth;
-extern const EVP_PKEY_ASN1_METHOD gostr01_asn1_meths[];
+extern const EVP_PKEY_ASN1_METHOD gostr01_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD gostr12_256_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD gostr12_512_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth;
-extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
+extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD rsa2_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD x25519_asn1_meth;
static const EVP_PKEY_ASN1_METHOD *asn1_methods[] = {
&cmac_asn1_meth,
&dh_asn1_meth,
- &dsa_asn1_meths[0],
- &dsa_asn1_meths[1],
- &dsa_asn1_meths[2],
- &dsa_asn1_meths[3],
- &dsa_asn1_meths[4],
+ &dsa_asn1_meth,
+ &dsa1_asn1_meth,
+ &dsa2_asn1_meth,
+ &dsa3_asn1_meth,
+ &dsa4_asn1_meth,
&eckey_asn1_meth,
&ed25519_asn1_meth,
&gostimit_asn1_meth,
- &gostr01_asn1_meths[0],
- &gostr01_asn1_meths[1],
- &gostr01_asn1_meths[2],
+ &gostr01_asn1_meth,
+ &gostr12_256_asn1_meth,
+ &gostr12_512_asn1_meth,
&hmac_asn1_meth,
- &rsa_asn1_meths[0],
- &rsa_asn1_meths[1],
+ &rsa_asn1_meth,
+ &rsa2_asn1_meth,
&rsa_pss_asn1_meth,
&x25519_asn1_meth,
};
-/* $OpenBSD: gostr341001_ameth.c,v 1.22 2023/12/28 21:53:09 tb Exp $ */
+/* $OpenBSD: gostr341001_ameth.c,v 1.23 2024/01/04 16:41:56 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
return 1;
}
-const EVP_PKEY_ASN1_METHOD gostr01_asn1_meths[] = {
- {
- .pkey_id = EVP_PKEY_GOSTR01,
- .pkey_base_id = EVP_PKEY_GOSTR01,
- .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
-
- .pem_str = "GOST2001",
- .info = "GOST R 34.10-2001",
-
- .pkey_free = pkey_free_gost01,
- .pkey_ctrl = pkey_ctrl_gost01,
-
- .priv_decode = priv_decode_gost01,
- .priv_encode = priv_encode_gost01,
- .priv_print = priv_print_gost01,
-
- .param_decode = param_decode_gost01,
- .param_encode = param_encode_gost01,
- .param_missing = param_missing_gost01,
- .param_copy = param_copy_gost01,
- .param_cmp = param_cmp_gost01,
- .param_print = param_print_gost01,
-
- .pub_decode = pub_decode_gost01,
- .pub_encode = pub_encode_gost01,
- .pub_cmp = pub_cmp_gost01,
- .pub_print = pub_print_gost01,
- .pkey_size = pkey_size_gost01,
- .pkey_bits = pkey_bits_gost01,
- },
- {
- .pkey_id = EVP_PKEY_GOSTR12_256,
- .pkey_base_id = EVP_PKEY_GOSTR01,
- .pkey_flags = ASN1_PKEY_ALIAS
- },
- {
- .pkey_id = EVP_PKEY_GOSTR12_512,
- .pkey_base_id = EVP_PKEY_GOSTR01,
- .pkey_flags = ASN1_PKEY_ALIAS
- },
+const EVP_PKEY_ASN1_METHOD gostr01_asn1_meth = {
+ .pkey_id = EVP_PKEY_GOSTR01,
+ .pkey_base_id = EVP_PKEY_GOSTR01,
+ .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
+
+ .pem_str = "GOST2001",
+ .info = "GOST R 34.10-2001",
+
+ .pkey_free = pkey_free_gost01,
+ .pkey_ctrl = pkey_ctrl_gost01,
+
+ .priv_decode = priv_decode_gost01,
+ .priv_encode = priv_encode_gost01,
+ .priv_print = priv_print_gost01,
+
+ .param_decode = param_decode_gost01,
+ .param_encode = param_encode_gost01,
+ .param_missing = param_missing_gost01,
+ .param_copy = param_copy_gost01,
+ .param_cmp = param_cmp_gost01,
+ .param_print = param_print_gost01,
+
+ .pub_decode = pub_decode_gost01,
+ .pub_encode = pub_encode_gost01,
+ .pub_cmp = pub_cmp_gost01,
+ .pub_print = pub_print_gost01,
+ .pkey_size = pkey_size_gost01,
+ .pkey_bits = pkey_bits_gost01,
+};
+
+const EVP_PKEY_ASN1_METHOD gostr12_256_asn1_meth = {
+ .pkey_id = EVP_PKEY_GOSTR12_256,
+ .pkey_base_id = EVP_PKEY_GOSTR01,
+ .pkey_flags = ASN1_PKEY_ALIAS,
+};
+
+const EVP_PKEY_ASN1_METHOD gostr12_512_asn1_meth = {
+ .pkey_id = EVP_PKEY_GOSTR12_512,
+ .pkey_base_id = EVP_PKEY_GOSTR01,
+ .pkey_flags = ASN1_PKEY_ALIAS,
};
#endif
-/* $OpenBSD: rsa_ameth.c,v 1.54 2024/01/01 15:43:02 tb Exp $ */
+/* $OpenBSD: rsa_ameth.c,v 1.55 2024/01/04 16:41:56 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
}
#endif
-const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
- {
- .pkey_id = EVP_PKEY_RSA,
- .pkey_base_id = EVP_PKEY_RSA,
- .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
+const EVP_PKEY_ASN1_METHOD rsa_asn1_meth = {
+ .pkey_id = EVP_PKEY_RSA,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_SIGPARAM_NULL,
- .pem_str = "RSA",
- .info = "OpenSSL RSA method",
+ .pem_str = "RSA",
+ .info = "OpenSSL RSA method",
- .pub_decode = rsa_pub_decode,
- .pub_encode = rsa_pub_encode,
- .pub_cmp = rsa_pub_cmp,
- .pub_print = rsa_pub_print,
+ .pub_decode = rsa_pub_decode,
+ .pub_encode = rsa_pub_encode,
+ .pub_cmp = rsa_pub_cmp,
+ .pub_print = rsa_pub_print,
- .priv_decode = rsa_priv_decode,
- .priv_encode = rsa_priv_encode,
- .priv_print = rsa_priv_print,
+ .priv_decode = rsa_priv_decode,
+ .priv_encode = rsa_priv_encode,
+ .priv_print = rsa_priv_print,
- .pkey_size = rsa_size,
- .pkey_bits = rsa_bits,
- .pkey_security_bits = rsa_security_bits,
+ .pkey_size = rsa_size,
+ .pkey_bits = rsa_bits,
+ .pkey_security_bits = rsa_security_bits,
- .sig_print = rsa_sig_print,
+ .sig_print = rsa_sig_print,
- .pkey_free = 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,
+ .pkey_free = 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,
- .pkey_check = rsa_pkey_check,
- },
+ .pkey_check = rsa_pkey_check,
+};
- {
- .pkey_id = EVP_PKEY_RSA2,
- .pkey_base_id = EVP_PKEY_RSA,
- .pkey_flags = ASN1_PKEY_ALIAS,
+const EVP_PKEY_ASN1_METHOD rsa2_asn1_meth = {
+ .pkey_id = EVP_PKEY_RSA2,
+ .pkey_base_id = EVP_PKEY_RSA,
+ .pkey_flags = ASN1_PKEY_ALIAS,
- .pkey_check = rsa_pkey_check,
- },
+ .pkey_check = rsa_pkey_check,
};
const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth = {