summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-03-02 10:03:13 +0000
committertb <>2024-03-02 10:03:13 +0000
commit10d41204e8ddb50a380449ffe06fcbff6b901565 (patch)
treec4cc7ad2519b1a29cfb700d282bcdba9777490df /src
parent390c4d5e48028e0a43621ca1bdbfb80aa119e1fc (diff)
downloadopenbsd-10d41204e8ddb50a380449ffe06fcbff6b901565.tar.gz
openbsd-10d41204e8ddb50a380449ffe06fcbff6b901565.tar.bz2
openbsd-10d41204e8ddb50a380449ffe06fcbff6b901565.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/Makefile3
-rw-r--r--src/lib/libcrypto/Symbols.list14
-rw-r--r--src/lib/libcrypto/asn1/ameth_lib.c180
-rw-r--r--src/lib/libcrypto/evp/evp.h44
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
3LIB= crypto 3LIB= crypto
4LIBREBUILD=y 4LIBREBUILD=y
@@ -96,7 +96,6 @@ SRCS+= a_time_posix.c
96SRCS+= a_time_tm.c 96SRCS+= a_time_tm.c
97SRCS+= a_type.c 97SRCS+= a_type.c
98SRCS+= a_utf8.c 98SRCS+= a_utf8.c
99SRCS+= ameth_lib.c
100SRCS+= asn1_err.c 99SRCS+= asn1_err.c
101SRCS+= asn1_gen.c 100SRCS+= asn1_gen.c
102SRCS+= asn1_item.c 101SRCS+= 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
1297EVP_PKEY_add1_attr_by_NID 1297EVP_PKEY_add1_attr_by_NID
1298EVP_PKEY_add1_attr_by_OBJ 1298EVP_PKEY_add1_attr_by_OBJ
1299EVP_PKEY_add1_attr_by_txt 1299EVP_PKEY_add1_attr_by_txt
1300EVP_PKEY_asn1_add0
1301EVP_PKEY_asn1_add_alias
1302EVP_PKEY_asn1_copy
1303EVP_PKEY_asn1_find 1300EVP_PKEY_asn1_find
1304EVP_PKEY_asn1_find_str 1301EVP_PKEY_asn1_find_str
1305EVP_PKEY_asn1_free
1306EVP_PKEY_asn1_get0 1302EVP_PKEY_asn1_get0
1307EVP_PKEY_asn1_get0_info 1303EVP_PKEY_asn1_get0_info
1308EVP_PKEY_asn1_get_count 1304EVP_PKEY_asn1_get_count
1309EVP_PKEY_asn1_new
1310EVP_PKEY_asn1_set_check
1311EVP_PKEY_asn1_set_ctrl
1312EVP_PKEY_asn1_set_free
1313EVP_PKEY_asn1_set_param
1314EVP_PKEY_asn1_set_param_check
1315EVP_PKEY_asn1_set_private
1316EVP_PKEY_asn1_set_public
1317EVP_PKEY_asn1_set_public_check
1318EVP_PKEY_asn1_set_security_bits
1319EVP_PKEY_assign 1305EVP_PKEY_assign
1320EVP_PKEY_base_id 1306EVP_PKEY_base_id
1321EVP_PKEY_bits 1307EVP_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
71EVP_PKEY_ASN1_METHOD*
72EVP_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
78void
79EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src)
80{
81 EVPerror(ERR_R_DISABLED);
82}
83
84void
85EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
86{
87 EVPerror(ERR_R_DISABLED);
88}
89
90void
91EVP_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
103void
104EVP_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
113void
114EVP_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
126void
127EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
128 void (*pkey_free)(EVP_PKEY *pkey))
129{
130 EVPerror(ERR_R_DISABLED);
131}
132
133void
134EVP_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
140void
141EVP_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
147void
148EVP_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
154void
155EVP_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
161void
162EVP_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
168int
169EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
170{
171 EVPerror(ERR_R_DISABLED);
172 return 0;
173}
174
175int
176EVP_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);
933const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); 933const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
934const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, 934const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
935 const char *str, int len); 935 const char *str, int len);
936int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
937int EVP_PKEY_asn1_add_alias(int to, int from);
938int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags, 936int 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
942const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); 940const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey);
943EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, const char *pem_str,
944 const char *info);
945void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
946 const EVP_PKEY_ASN1_METHOD *src);
947void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
948void 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));
956void 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));
961void 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
970void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
971 void (*pkey_free)(EVP_PKEY *pkey));
972void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
973 int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2));
974void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
975 int (*pkey_security_bits)(const EVP_PKEY *pkey));
976
977void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
978 int (*pkey_check)(const EVP_PKEY *pk));
979void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
980 int (*pkey_public_check)(const EVP_PKEY *pk));
981void 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)