diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/evp/evp_pkey.c | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c index f9100e2268..dcbd51f08d 100644 --- a/src/lib/libcrypto/evp/evp_pkey.c +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: evp_pkey.c,v 1.30 2024/07/14 16:06:31 tb Exp $ */ | 1 | /* $OpenBSD: evp_pkey.c,v 1.31 2024/08/22 12:21:07 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 1999. | 3 | * project 1999. |
| 4 | */ | 4 | */ |
| @@ -142,49 +142,18 @@ error: | |||
| 142 | LCRYPTO_ALIAS(EVP_PKEY2PKCS8); | 142 | LCRYPTO_ALIAS(EVP_PKEY2PKCS8); |
| 143 | 143 | ||
| 144 | /* | 144 | /* |
| 145 | * XXX - This is only used by openssl(1) pkcs12 for the Microsoft-specific | 145 | * XXX - delete all the garbage below in the next bump. |
| 146 | * NID_ms_csp_name and NID_LocalKeySet. This turns out to be the only reason | ||
| 147 | * why attributes hangs off the EVP_PKEY struct. | ||
| 148 | */ | 146 | */ |
| 147 | |||
| 149 | int | 148 | int |
| 150 | EVP_PKEY_add1_attr_by_NID(EVP_PKEY *pkey, int nid, int type, | 149 | EVP_PKEY_add1_attr_by_NID(EVP_PKEY *pkey, int nid, int type, |
| 151 | const unsigned char *bytes, int len) | 150 | const unsigned char *bytes, int len) |
| 152 | { | 151 | { |
| 153 | STACK_OF(X509_ATTRIBUTE) *attrs = NULL; | 152 | EVPerror(ERR_R_DISABLED); |
| 154 | X509_ATTRIBUTE *attr = NULL; | 153 | return 0; |
| 155 | int ret = 0; | ||
| 156 | |||
| 157 | if ((attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, | ||
| 158 | bytes, len)) == NULL) | ||
| 159 | goto err; | ||
| 160 | |||
| 161 | if ((attrs = pkey->attributes) == NULL) | ||
| 162 | attrs = sk_X509_ATTRIBUTE_new_null(); | ||
| 163 | if (attrs == NULL) | ||
| 164 | goto err; | ||
| 165 | |||
| 166 | if (sk_X509_ATTRIBUTE_push(attrs, attr) <= 0) | ||
| 167 | goto err; | ||
| 168 | attr = NULL; | ||
| 169 | |||
| 170 | pkey->attributes = attrs; | ||
| 171 | attrs = NULL; | ||
| 172 | |||
| 173 | ret = 1; | ||
| 174 | |||
| 175 | err: | ||
| 176 | X509_ATTRIBUTE_free(attr); | ||
| 177 | if (attrs != pkey->attributes) | ||
| 178 | sk_X509_ATTRIBUTE_pop_free(attrs, X509_ATTRIBUTE_free); | ||
| 179 | |||
| 180 | return ret; | ||
| 181 | } | 154 | } |
| 182 | LCRYPTO_ALIAS(EVP_PKEY_add1_attr_by_NID); | 155 | LCRYPTO_ALIAS(EVP_PKEY_add1_attr_by_NID); |
| 183 | 156 | ||
| 184 | /* | ||
| 185 | * XXX - delete all the garbage below in the next bump. | ||
| 186 | */ | ||
| 187 | |||
| 188 | int | 157 | int |
| 189 | EVP_PKEY_get_attr_count(const EVP_PKEY *key) | 158 | EVP_PKEY_get_attr_count(const EVP_PKEY *key) |
| 190 | { | 159 | { |
