Remove i2d_X509_PKEY and d2i_X509_PKEY.
One of them was never implemented upstream or downstream. The other no longer works in BoringSSL. They're not used within BoringSSL (this still compiles), even in X509_INFO, and do not appear to be used by consumers. If they were, we would like to know via a compile failure. This removes the last consumer within BoringSSL of the ASN.1 parsing macros. Change-Id: Ifb72b1fcd0a4f7b3e6b081486f8638110872334b Reviewed-on: https://boringssl-review.googlesource.com/2203 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
9ed9dae18e
commit
b044020f84
@ -57,58 +57,10 @@
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1_mac.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
|
||||
OPENSSL_DECLARE_ERROR_FUNCTION(X509, d2i_X509_PKEY);
|
||||
|
||||
/* 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=NULL;
|
||||
|
||||
/* TODO(fork): fix */
|
||||
/*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,X509_F_d2i_X509_PKEY);
|
||||
}
|
||||
|
||||
X509_PKEY *X509_PKEY_new(void)
|
||||
{
|
||||
X509_PKEY *ret = OPENSSL_malloc(sizeof(X509_PKEY));
|
||||
|
@ -826,8 +826,6 @@ OPENSSL_EXPORT int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509
|
||||
|
||||
OPENSSL_EXPORT X509_PKEY * X509_PKEY_new(void );
|
||||
OPENSSL_EXPORT void X509_PKEY_free(X509_PKEY *a);
|
||||
OPENSSL_EXPORT int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
|
||||
OPENSSL_EXPORT X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
|
||||
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
|
||||
|
Loading…
Reference in New Issue
Block a user