summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordoug <>2015-04-12 15:15:51 +0000
committerdoug <>2015-04-12 15:15:51 +0000
commitecccb89eeee5c8174d370147c737ee62dcd006d6 (patch)
treea2c23d496914eae83be511d4f5f0df8f660817f9 /src/lib
parent0f4348bfcce7ca22317af7acf3b98ba84ad07eaa (diff)
downloadopenbsd-ecccb89eeee5c8174d370147c737ee62dcd006d6.tar.gz
openbsd-ecccb89eeee5c8174d370147c737ee62dcd006d6.tar.bz2
openbsd-ecccb89eeee5c8174d370147c737ee62dcd006d6.zip
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@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c42
-rw-r--r--src/lib/libcrypto/x509/x509.h4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_pkey.c42
-rw-r--r--src/lib/libssl/src/crypto/x509/x509.h4
4 files changed, 4 insertions, 88 deletions
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index d454afb72b..9523740af7 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pkey.c,v 1.15 2014/07/12 16:03:36 miod Exp $ */ 1/* $OpenBSD: x_pkey.c,v 1.16 2015/04/12 15:15:51 doug 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 *
@@ -65,46 +65,6 @@
65#include <openssl/objects.h> 65#include <openssl/objects.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68/* need to implement */
69int
70i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
71{
72 return (0);
73}
74
75X509_PKEY *
76d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
77{
78 int i;
79 M_ASN1_D2I_vars(a, X509_PKEY *, X509_PKEY_new);
80
81 M_ASN1_D2I_Init();
82 M_ASN1_D2I_start_sequence();
83 M_ASN1_D2I_get_x(X509_ALGOR, ret->enc_algor, d2i_X509_ALGOR);
84 M_ASN1_D2I_get_x(ASN1_OCTET_STRING, ret->enc_pkey,
85 d2i_ASN1_OCTET_STRING);
86
87 ret->cipher.cipher = EVP_get_cipherbyname(
88 OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm)));
89 if (ret->cipher.cipher == NULL) {
90 c.error = ASN1_R_UNSUPPORTED_CIPHER;
91 c.line = __LINE__;
92 goto err;
93 }
94 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) {
95 i = ret->enc_algor->parameter->value.octet_string->length;
96 if (i > EVP_MAX_IV_LENGTH) {
97 c.error = ASN1_R_IV_TOO_LARGE;
98 c.line = __LINE__;
99 goto err;
100 }
101 memcpy(ret->cipher.iv,
102 ret->enc_algor->parameter->value.octet_string->data, i);
103 } else
104 memset(ret->cipher.iv, 0, EVP_MAX_IV_LENGTH);
105 M_ASN1_D2I_Finish(a, X509_PKEY_free, ASN1_F_D2I_X509_PKEY);
106}
107
108X509_PKEY * 68X509_PKEY *
109X509_PKEY_new(void) 69X509_PKEY_new(void)
110{ 70{
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index ec6668d35e..cf00ea5ebe 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.22 2015/02/11 02:17:59 jsing Exp $ */ 1/* $OpenBSD: x509.h,v 1.23 2015/04/12 15:15:51 doug 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 *
@@ -857,8 +857,6 @@ int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
857 857
858X509_PKEY * X509_PKEY_new(void ); 858X509_PKEY * X509_PKEY_new(void );
859void X509_PKEY_free(X509_PKEY *a); 859void X509_PKEY_free(X509_PKEY *a);
860int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
861X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
862 860
863DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) 861DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
864DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) 862DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
diff --git a/src/lib/libssl/src/crypto/asn1/x_pkey.c b/src/lib/libssl/src/crypto/asn1/x_pkey.c
index d454afb72b..9523740af7 100644
--- a/src/lib/libssl/src/crypto/asn1/x_pkey.c
+++ b/src/lib/libssl/src/crypto/asn1/x_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pkey.c,v 1.15 2014/07/12 16:03:36 miod Exp $ */ 1/* $OpenBSD: x_pkey.c,v 1.16 2015/04/12 15:15:51 doug 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 *
@@ -65,46 +65,6 @@
65#include <openssl/objects.h> 65#include <openssl/objects.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68/* need to implement */
69int
70i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
71{
72 return (0);
73}
74
75X509_PKEY *
76d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
77{
78 int i;
79 M_ASN1_D2I_vars(a, X509_PKEY *, X509_PKEY_new);
80
81 M_ASN1_D2I_Init();
82 M_ASN1_D2I_start_sequence();
83 M_ASN1_D2I_get_x(X509_ALGOR, ret->enc_algor, d2i_X509_ALGOR);
84 M_ASN1_D2I_get_x(ASN1_OCTET_STRING, ret->enc_pkey,
85 d2i_ASN1_OCTET_STRING);
86
87 ret->cipher.cipher = EVP_get_cipherbyname(
88 OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm)));
89 if (ret->cipher.cipher == NULL) {
90 c.error = ASN1_R_UNSUPPORTED_CIPHER;
91 c.line = __LINE__;
92 goto err;
93 }
94 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) {
95 i = ret->enc_algor->parameter->value.octet_string->length;
96 if (i > EVP_MAX_IV_LENGTH) {
97 c.error = ASN1_R_IV_TOO_LARGE;
98 c.line = __LINE__;
99 goto err;
100 }
101 memcpy(ret->cipher.iv,
102 ret->enc_algor->parameter->value.octet_string->data, i);
103 } else
104 memset(ret->cipher.iv, 0, EVP_MAX_IV_LENGTH);
105 M_ASN1_D2I_Finish(a, X509_PKEY_free, ASN1_F_D2I_X509_PKEY);
106}
107
108X509_PKEY * 68X509_PKEY *
109X509_PKEY_new(void) 69X509_PKEY_new(void)
110{ 70{
diff --git a/src/lib/libssl/src/crypto/x509/x509.h b/src/lib/libssl/src/crypto/x509/x509.h
index ec6668d35e..cf00ea5ebe 100644
--- a/src/lib/libssl/src/crypto/x509/x509.h
+++ b/src/lib/libssl/src/crypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.22 2015/02/11 02:17:59 jsing Exp $ */ 1/* $OpenBSD: x509.h,v 1.23 2015/04/12 15:15:51 doug 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 *
@@ -857,8 +857,6 @@ int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
857 857
858X509_PKEY * X509_PKEY_new(void ); 858X509_PKEY * X509_PKEY_new(void );
859void X509_PKEY_free(X509_PKEY *a); 859void X509_PKEY_free(X509_PKEY *a);
860int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
861X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
862 860
863DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) 861DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
864DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) 862DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)