From 2a5636e1fc0ebf6873394c4553c201a770081130 Mon Sep 17 00:00:00 2001 From: doug Date: Sun, 12 Apr 2015 15:15:51 +0000 Subject: [PATCH] Remove d2i_X509_PKEY and i2d_X509_PKEY from the SSLeay days. i2d_X509_PKEY is a "needs to implement" and d2i_X509_PKEY is broken. Removed upstream in commit b1f3442857c1fd76e91941141bf671d19e90a79d. ok deraadt@, jsing@ --- lib/libcrypto/asn1/x_pkey.c | 42 +---------------------------- lib/libcrypto/x509/x509.h | 4 +-- lib/libssl/src/crypto/asn1/x_pkey.c | 42 +---------------------------- lib/libssl/src/crypto/x509/x509.h | 4 +-- 4 files changed, 4 insertions(+), 88 deletions(-) diff --git a/lib/libcrypto/asn1/x_pkey.c b/lib/libcrypto/asn1/x_pkey.c index d454afb72bb..9523740af72 100644 --- a/lib/libcrypto/asn1/x_pkey.c +++ b/lib/libcrypto/asn1/x_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_pkey.c,v 1.15 2014/07/12 16:03:36 miod Exp $ */ +/* $OpenBSD: x_pkey.c,v 1.16 2015/04/12 15:15:51 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,46 +65,6 @@ #include #include -/* need to implement */ -int -i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp) -{ - return (0); -} - -X509_PKEY * -d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length) -{ - int i; - M_ASN1_D2I_vars(a, X509_PKEY *, X509_PKEY_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get_x(X509_ALGOR, ret->enc_algor, d2i_X509_ALGOR); - M_ASN1_D2I_get_x(ASN1_OCTET_STRING, ret->enc_pkey, - d2i_ASN1_OCTET_STRING); - - ret->cipher.cipher = EVP_get_cipherbyname( - OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm))); - if (ret->cipher.cipher == NULL) { - c.error = ASN1_R_UNSUPPORTED_CIPHER; - c.line = __LINE__; - goto err; - } - if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) { - i = ret->enc_algor->parameter->value.octet_string->length; - if (i > EVP_MAX_IV_LENGTH) { - c.error = ASN1_R_IV_TOO_LARGE; - c.line = __LINE__; - goto err; - } - memcpy(ret->cipher.iv, - ret->enc_algor->parameter->value.octet_string->data, i); - } else - memset(ret->cipher.iv, 0, EVP_MAX_IV_LENGTH); - M_ASN1_D2I_Finish(a, X509_PKEY_free, ASN1_F_D2I_X509_PKEY); -} - X509_PKEY * X509_PKEY_new(void) { diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index ec6668d35ef..cf00ea5ebed 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.22 2015/02/11 02:17:59 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.23 2015/04/12 15:15:51 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -857,8 +857,6 @@ int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); X509_PKEY * X509_PKEY_new(void ); void X509_PKEY_free(X509_PKEY *a); -int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); -X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length); DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) diff --git a/lib/libssl/src/crypto/asn1/x_pkey.c b/lib/libssl/src/crypto/asn1/x_pkey.c index d454afb72bb..9523740af72 100644 --- a/lib/libssl/src/crypto/asn1/x_pkey.c +++ b/lib/libssl/src/crypto/asn1/x_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_pkey.c,v 1.15 2014/07/12 16:03:36 miod Exp $ */ +/* $OpenBSD: x_pkey.c,v 1.16 2015/04/12 15:15:51 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,46 +65,6 @@ #include #include -/* need to implement */ -int -i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp) -{ - return (0); -} - -X509_PKEY * -d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length) -{ - int i; - M_ASN1_D2I_vars(a, X509_PKEY *, X509_PKEY_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get_x(X509_ALGOR, ret->enc_algor, d2i_X509_ALGOR); - M_ASN1_D2I_get_x(ASN1_OCTET_STRING, ret->enc_pkey, - d2i_ASN1_OCTET_STRING); - - ret->cipher.cipher = EVP_get_cipherbyname( - OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm))); - if (ret->cipher.cipher == NULL) { - c.error = ASN1_R_UNSUPPORTED_CIPHER; - c.line = __LINE__; - goto err; - } - if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) { - i = ret->enc_algor->parameter->value.octet_string->length; - if (i > EVP_MAX_IV_LENGTH) { - c.error = ASN1_R_IV_TOO_LARGE; - c.line = __LINE__; - goto err; - } - memcpy(ret->cipher.iv, - ret->enc_algor->parameter->value.octet_string->data, i); - } else - memset(ret->cipher.iv, 0, EVP_MAX_IV_LENGTH); - M_ASN1_D2I_Finish(a, X509_PKEY_free, ASN1_F_D2I_X509_PKEY); -} - X509_PKEY * X509_PKEY_new(void) { diff --git a/lib/libssl/src/crypto/x509/x509.h b/lib/libssl/src/crypto/x509/x509.h index ec6668d35ef..cf00ea5ebed 100644 --- a/lib/libssl/src/crypto/x509/x509.h +++ b/lib/libssl/src/crypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.22 2015/02/11 02:17:59 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.23 2015/04/12 15:15:51 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -857,8 +857,6 @@ int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); X509_PKEY * X509_PKEY_new(void ); void X509_PKEY_free(X509_PKEY *a); -int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); -X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length); DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) -- 2.20.1