diff options
| author | tb <> | 2024-01-04 16:41:56 +0000 |
|---|---|---|
| committer | tb <> | 2024-01-04 16:41:56 +0000 |
| commit | b1aedf2a14d9cd341b6b3b19a90343383ec0209f (patch) | |
| tree | 42c88a97ebc87bb0e93b4c3ce66bffb8d866247f /src/lib/libcrypto/gost | |
| parent | 76e5444b8b83a458d445e4aed6454246db6b0c88 (diff) | |
| download | openbsd-b1aedf2a14d9cd341b6b3b19a90343383ec0209f.tar.gz openbsd-b1aedf2a14d9cd341b6b3b19a90343383ec0209f.tar.bz2 openbsd-b1aedf2a14d9cd341b6b3b19a90343383ec0209f.zip | |
Split ameth arrays into individual methods
For some reason DSA, GOST, and RSA had their ASN.1 methods stored in
an array. This is clumsy and the only benefit is that one saves a few
externs in p_lib.c. They were also arranged by ascending NID because
of bsearch() madness.
Split them up and arrange the methods by name, which is much saner
and simpler.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/gost')
| -rw-r--r-- | src/lib/libcrypto/gost/gostr341001_ameth.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/lib/libcrypto/gost/gostr341001_ameth.c b/src/lib/libcrypto/gost/gostr341001_ameth.c index fc3bce412a..f917827f7a 100644 --- a/src/lib/libcrypto/gost/gostr341001_ameth.c +++ b/src/lib/libcrypto/gost/gostr341001_ameth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.22 2023/12/28 21:53:09 tb Exp $ */ | 1 | /* $OpenBSD: gostr341001_ameth.c,v 1.23 2024/01/04 16:41:56 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
| @@ -682,46 +682,46 @@ pkey_ctrl_gost01(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
| 682 | return 1; | 682 | return 1; |
| 683 | } | 683 | } |
| 684 | 684 | ||
| 685 | const EVP_PKEY_ASN1_METHOD gostr01_asn1_meths[] = { | 685 | const EVP_PKEY_ASN1_METHOD gostr01_asn1_meth = { |
| 686 | { | 686 | .pkey_id = EVP_PKEY_GOSTR01, |
| 687 | .pkey_id = EVP_PKEY_GOSTR01, | 687 | .pkey_base_id = EVP_PKEY_GOSTR01, |
| 688 | .pkey_base_id = EVP_PKEY_GOSTR01, | 688 | .pkey_flags = ASN1_PKEY_SIGPARAM_NULL, |
| 689 | .pkey_flags = ASN1_PKEY_SIGPARAM_NULL, | 689 | |
| 690 | 690 | .pem_str = "GOST2001", | |
| 691 | .pem_str = "GOST2001", | 691 | .info = "GOST R 34.10-2001", |
| 692 | .info = "GOST R 34.10-2001", | 692 | |
| 693 | 693 | .pkey_free = pkey_free_gost01, | |
| 694 | .pkey_free = pkey_free_gost01, | 694 | .pkey_ctrl = pkey_ctrl_gost01, |
| 695 | .pkey_ctrl = pkey_ctrl_gost01, | 695 | |
| 696 | 696 | .priv_decode = priv_decode_gost01, | |
| 697 | .priv_decode = priv_decode_gost01, | 697 | .priv_encode = priv_encode_gost01, |
| 698 | .priv_encode = priv_encode_gost01, | 698 | .priv_print = priv_print_gost01, |
| 699 | .priv_print = priv_print_gost01, | 699 | |
| 700 | 700 | .param_decode = param_decode_gost01, | |
| 701 | .param_decode = param_decode_gost01, | 701 | .param_encode = param_encode_gost01, |
| 702 | .param_encode = param_encode_gost01, | 702 | .param_missing = param_missing_gost01, |
| 703 | .param_missing = param_missing_gost01, | 703 | .param_copy = param_copy_gost01, |
| 704 | .param_copy = param_copy_gost01, | 704 | .param_cmp = param_cmp_gost01, |
| 705 | .param_cmp = param_cmp_gost01, | 705 | .param_print = param_print_gost01, |
| 706 | .param_print = param_print_gost01, | 706 | |
| 707 | 707 | .pub_decode = pub_decode_gost01, | |
| 708 | .pub_decode = pub_decode_gost01, | 708 | .pub_encode = pub_encode_gost01, |
| 709 | .pub_encode = pub_encode_gost01, | 709 | .pub_cmp = pub_cmp_gost01, |
| 710 | .pub_cmp = pub_cmp_gost01, | 710 | .pub_print = pub_print_gost01, |
| 711 | .pub_print = pub_print_gost01, | 711 | .pkey_size = pkey_size_gost01, |
| 712 | .pkey_size = pkey_size_gost01, | 712 | .pkey_bits = pkey_bits_gost01, |
| 713 | .pkey_bits = pkey_bits_gost01, | 713 | }; |
| 714 | }, | 714 | |
| 715 | { | 715 | const EVP_PKEY_ASN1_METHOD gostr12_256_asn1_meth = { |
| 716 | .pkey_id = EVP_PKEY_GOSTR12_256, | 716 | .pkey_id = EVP_PKEY_GOSTR12_256, |
| 717 | .pkey_base_id = EVP_PKEY_GOSTR01, | 717 | .pkey_base_id = EVP_PKEY_GOSTR01, |
| 718 | .pkey_flags = ASN1_PKEY_ALIAS | 718 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 719 | }, | 719 | }; |
| 720 | { | 720 | |
| 721 | .pkey_id = EVP_PKEY_GOSTR12_512, | 721 | const EVP_PKEY_ASN1_METHOD gostr12_512_asn1_meth = { |
| 722 | .pkey_base_id = EVP_PKEY_GOSTR01, | 722 | .pkey_id = EVP_PKEY_GOSTR12_512, |
| 723 | .pkey_flags = ASN1_PKEY_ALIAS | 723 | .pkey_base_id = EVP_PKEY_GOSTR01, |
| 724 | }, | 724 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 725 | }; | 725 | }; |
| 726 | 726 | ||
| 727 | #endif | 727 | #endif |
