diff options
| author | tb <> | 2024-03-02 10:03:13 +0000 |
|---|---|---|
| committer | tb <> | 2024-03-02 10:03:13 +0000 |
| commit | 4ca63f0c3efae2522713a42bfe9cd20f7369b0fc (patch) | |
| tree | c4cc7ad2519b1a29cfb700d282bcdba9777490df /src | |
| parent | 1894c9da2aed32c69be2c297ff92c86f701c6ddd (diff) | |
| download | openbsd-4ca63f0c3efae2522713a42bfe9cd20f7369b0fc.tar.gz openbsd-4ca63f0c3efae2522713a42bfe9cd20f7369b0fc.tar.bz2 openbsd-4ca63f0c3efae2522713a42bfe9cd20f7369b0fc.zip | |
Remove the ameth lib
This is accessor API for ASN.1 methods needed for custom PKEYs.
Nothing has ever used this. This has been neutered for months.
The EVP_PKEY_asn1_* API that needs to stay was moved elsewhere.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/Makefile | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/Symbols.list | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/ameth_lib.c | 180 | ||||
| -rw-r--r-- | src/lib/libcrypto/evp/evp.h | 44 |
4 files changed, 2 insertions, 239 deletions
diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index 0ddf74246c..b7fb2d0ff7 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.168 2024/02/18 16:28:37 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.169 2024/03/02 10:03:12 tb Exp $ |
| 2 | 2 | ||
| 3 | LIB= crypto | 3 | LIB= crypto |
| 4 | LIBREBUILD=y | 4 | LIBREBUILD=y |
| @@ -96,7 +96,6 @@ SRCS+= a_time_posix.c | |||
| 96 | SRCS+= a_time_tm.c | 96 | SRCS+= a_time_tm.c |
| 97 | SRCS+= a_type.c | 97 | SRCS+= a_type.c |
| 98 | SRCS+= a_utf8.c | 98 | SRCS+= a_utf8.c |
| 99 | SRCS+= ameth_lib.c | ||
| 100 | SRCS+= asn1_err.c | 99 | SRCS+= asn1_err.c |
| 101 | SRCS+= asn1_gen.c | 100 | SRCS+= asn1_gen.c |
| 102 | SRCS+= asn1_item.c | 101 | SRCS+= asn1_item.c |
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 94ccf0d016..ba54a932ee 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
| @@ -1297,25 +1297,11 @@ EVP_PKEY_add1_attr | |||
| 1297 | EVP_PKEY_add1_attr_by_NID | 1297 | EVP_PKEY_add1_attr_by_NID |
| 1298 | EVP_PKEY_add1_attr_by_OBJ | 1298 | EVP_PKEY_add1_attr_by_OBJ |
| 1299 | EVP_PKEY_add1_attr_by_txt | 1299 | EVP_PKEY_add1_attr_by_txt |
| 1300 | EVP_PKEY_asn1_add0 | ||
| 1301 | EVP_PKEY_asn1_add_alias | ||
| 1302 | EVP_PKEY_asn1_copy | ||
| 1303 | EVP_PKEY_asn1_find | 1300 | EVP_PKEY_asn1_find |
| 1304 | EVP_PKEY_asn1_find_str | 1301 | EVP_PKEY_asn1_find_str |
| 1305 | EVP_PKEY_asn1_free | ||
| 1306 | EVP_PKEY_asn1_get0 | 1302 | EVP_PKEY_asn1_get0 |
| 1307 | EVP_PKEY_asn1_get0_info | 1303 | EVP_PKEY_asn1_get0_info |
| 1308 | EVP_PKEY_asn1_get_count | 1304 | EVP_PKEY_asn1_get_count |
| 1309 | EVP_PKEY_asn1_new | ||
| 1310 | EVP_PKEY_asn1_set_check | ||
| 1311 | EVP_PKEY_asn1_set_ctrl | ||
| 1312 | EVP_PKEY_asn1_set_free | ||
| 1313 | EVP_PKEY_asn1_set_param | ||
| 1314 | EVP_PKEY_asn1_set_param_check | ||
| 1315 | EVP_PKEY_asn1_set_private | ||
| 1316 | EVP_PKEY_asn1_set_public | ||
| 1317 | EVP_PKEY_asn1_set_public_check | ||
| 1318 | EVP_PKEY_asn1_set_security_bits | ||
| 1319 | EVP_PKEY_assign | 1305 | EVP_PKEY_assign |
| 1320 | EVP_PKEY_base_id | 1306 | EVP_PKEY_base_id |
| 1321 | EVP_PKEY_bits | 1307 | EVP_PKEY_bits |
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c deleted file mode 100644 index 35fcb8ea08..0000000000 --- a/src/lib/libcrypto/asn1/ameth_lib.c +++ /dev/null | |||
| @@ -1,180 +0,0 @@ | |||
| 1 | /* $OpenBSD: ameth_lib.c,v 1.42 2024/01/04 16:50:53 tb Exp $ */ | ||
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
| 3 | * project 2006. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * 1. Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in | ||
| 17 | * the documentation and/or other materials provided with the | ||
| 18 | * distribution. | ||
| 19 | * | ||
| 20 | * 3. All advertising materials mentioning features or use of this | ||
| 21 | * software must display the following acknowledgment: | ||
| 22 | * "This product includes software developed by the OpenSSL Project | ||
| 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
| 24 | * | ||
| 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 26 | * endorse or promote products derived from this software without | ||
| 27 | * prior written permission. For written permission, please contact | ||
| 28 | * licensing@OpenSSL.org. | ||
| 29 | * | ||
| 30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 31 | * nor may "OpenSSL" appear in their names without prior written | ||
| 32 | * permission of the OpenSSL Project. | ||
| 33 | * | ||
| 34 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 35 | * acknowledgment: | ||
| 36 | * "This product includes software developed by the OpenSSL Project | ||
| 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
| 38 | * | ||
| 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 51 | * ==================================================================== | ||
| 52 | * | ||
| 53 | * This product includes cryptographic software written by Eric Young | ||
| 54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
| 55 | * Hudson (tjh@cryptsoft.com). | ||
| 56 | * | ||
| 57 | */ | ||
| 58 | |||
| 59 | #include <stdlib.h> | ||
| 60 | #include <string.h> | ||
| 61 | |||
| 62 | #include <openssl/err.h> | ||
| 63 | #include <openssl/evp.h> | ||
| 64 | |||
| 65 | #include "evp_local.h" | ||
| 66 | |||
| 67 | /* | ||
| 68 | * XXX - remove all the API below here in the next major bump. | ||
| 69 | */ | ||
| 70 | |||
| 71 | EVP_PKEY_ASN1_METHOD* | ||
| 72 | EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info) | ||
| 73 | { | ||
| 74 | EVPerror(ERR_R_DISABLED); | ||
| 75 | return NULL; | ||
| 76 | } | ||
| 77 | |||
| 78 | void | ||
| 79 | EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src) | ||
| 80 | { | ||
| 81 | EVPerror(ERR_R_DISABLED); | ||
| 82 | } | ||
| 83 | |||
| 84 | void | ||
| 85 | EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) | ||
| 86 | { | ||
| 87 | EVPerror(ERR_R_DISABLED); | ||
| 88 | } | ||
| 89 | |||
| 90 | void | ||
| 91 | EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 92 | int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub), | ||
| 93 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk), | ||
| 94 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), | ||
| 95 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 96 | ASN1_PCTX *pctx), | ||
| 97 | int (*pkey_size)(const EVP_PKEY *pk), | ||
| 98 | int (*pkey_bits)(const EVP_PKEY *pk)) | ||
| 99 | { | ||
| 100 | EVPerror(ERR_R_DISABLED); | ||
| 101 | } | ||
| 102 | |||
| 103 | void | ||
| 104 | EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 105 | int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), | ||
| 106 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), | ||
| 107 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 108 | ASN1_PCTX *pctx)) | ||
| 109 | { | ||
| 110 | EVPerror(ERR_R_DISABLED); | ||
| 111 | } | ||
| 112 | |||
| 113 | void | ||
| 114 | EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 115 | int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, int derlen), | ||
| 116 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder), | ||
| 117 | int (*param_missing)(const EVP_PKEY *pk), | ||
| 118 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from), | ||
| 119 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), | ||
| 120 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 121 | ASN1_PCTX *pctx)) | ||
| 122 | { | ||
| 123 | EVPerror(ERR_R_DISABLED); | ||
| 124 | } | ||
| 125 | |||
| 126 | void | ||
| 127 | EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 128 | void (*pkey_free)(EVP_PKEY *pkey)) | ||
| 129 | { | ||
| 130 | EVPerror(ERR_R_DISABLED); | ||
| 131 | } | ||
| 132 | |||
| 133 | void | ||
| 134 | EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 135 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)) | ||
| 136 | { | ||
| 137 | EVPerror(ERR_R_DISABLED); | ||
| 138 | } | ||
| 139 | |||
| 140 | void | ||
| 141 | EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 142 | int (*pkey_security_bits)(const EVP_PKEY *pkey)) | ||
| 143 | { | ||
| 144 | EVPerror(ERR_R_DISABLED); | ||
| 145 | } | ||
| 146 | |||
| 147 | void | ||
| 148 | EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 149 | int (*pkey_check)(const EVP_PKEY *pk)) | ||
| 150 | { | ||
| 151 | EVPerror(ERR_R_DISABLED); | ||
| 152 | } | ||
| 153 | |||
| 154 | void | ||
| 155 | EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 156 | int (*pkey_public_check)(const EVP_PKEY *pk)) | ||
| 157 | { | ||
| 158 | EVPerror(ERR_R_DISABLED); | ||
| 159 | } | ||
| 160 | |||
| 161 | void | ||
| 162 | EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 163 | int (*pkey_param_check)(const EVP_PKEY *pk)) | ||
| 164 | { | ||
| 165 | EVPerror(ERR_R_DISABLED); | ||
| 166 | } | ||
| 167 | |||
| 168 | int | ||
| 169 | EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth) | ||
| 170 | { | ||
| 171 | EVPerror(ERR_R_DISABLED); | ||
| 172 | return 0; | ||
| 173 | } | ||
| 174 | |||
| 175 | int | ||
| 176 | EVP_PKEY_asn1_add_alias(int to, int from) | ||
| 177 | { | ||
| 178 | EVPerror(ERR_R_DISABLED); | ||
| 179 | return 0; | ||
| 180 | } | ||
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index 09cd364ac4..90e29bd0d8 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: evp.h,v 1.125 2024/03/02 09:59:56 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.126 2024/03/02 10:03:13 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -933,53 +933,11 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); | |||
| 933 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); | 933 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); |
| 934 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, | 934 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, |
| 935 | const char *str, int len); | 935 | const char *str, int len); |
| 936 | int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); | ||
| 937 | int EVP_PKEY_asn1_add_alias(int to, int from); | ||
| 938 | int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags, | 936 | int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags, |
| 939 | const char **pinfo, const char **ppem_str, | 937 | const char **pinfo, const char **ppem_str, |
| 940 | const EVP_PKEY_ASN1_METHOD *ameth); | 938 | const EVP_PKEY_ASN1_METHOD *ameth); |
| 941 | 939 | ||
| 942 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); | 940 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); |
| 943 | EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, | ||
| 944 | const char *info); | ||
| 945 | void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, | ||
| 946 | const EVP_PKEY_ASN1_METHOD *src); | ||
| 947 | void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); | ||
| 948 | void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 949 | int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub), | ||
| 950 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk), | ||
| 951 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), | ||
| 952 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 953 | ASN1_PCTX *pctx), | ||
| 954 | int (*pkey_size)(const EVP_PKEY *pk), | ||
| 955 | int (*pkey_bits)(const EVP_PKEY *pk)); | ||
| 956 | void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 957 | int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), | ||
| 958 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), | ||
| 959 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 960 | ASN1_PCTX *pctx)); | ||
| 961 | void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 962 | int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, int derlen), | ||
| 963 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder), | ||
| 964 | int (*param_missing)(const EVP_PKEY *pk), | ||
| 965 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from), | ||
| 966 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), | ||
| 967 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, | ||
| 968 | ASN1_PCTX *pctx)); | ||
| 969 | |||
| 970 | void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 971 | void (*pkey_free)(EVP_PKEY *pkey)); | ||
| 972 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 973 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); | ||
| 974 | void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 975 | int (*pkey_security_bits)(const EVP_PKEY *pkey)); | ||
| 976 | |||
| 977 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 978 | int (*pkey_check)(const EVP_PKEY *pk)); | ||
| 979 | void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 980 | int (*pkey_public_check)(const EVP_PKEY *pk)); | ||
| 981 | void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, | ||
| 982 | int (*pkey_check)(const EVP_PKEY *pk)); | ||
| 983 | 941 | ||
| 984 | #define EVP_PKEY_OP_UNDEFINED 0 | 942 | #define EVP_PKEY_OP_UNDEFINED 0 |
| 985 | #define EVP_PKEY_OP_PARAMGEN (1<<1) | 943 | #define EVP_PKEY_OP_PARAMGEN (1<<1) |
