summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/x_pkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/x_pkey.c')
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index 1d4d926129..b0057eb212 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -58,25 +58,18 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp.h" 61#include <openssl/evp.h>
62#include "objects.h" 62#include <openssl/objects.h>
63#include "asn1_mac.h" 63#include <openssl/asn1_mac.h>
64 64#include <openssl/x509.h>
65/* ASN1err(ASN1_F_D2I_X509_PKEY,ASN1_R_UNSUPPORTED_CIPHER); */
66/* ASN1err(ASN1_F_X509_PKEY_NEW,ASN1_R_IV_TOO_LARGE); */
67 65
68/* need to implement */ 66/* need to implement */
69int i2d_X509_PKEY(a,pp) 67int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
70X509_PKEY *a;
71unsigned char **pp;
72 { 68 {
73 return(0); 69 return(0);
74 } 70 }
75 71
76X509_PKEY *d2i_X509_PKEY(a,pp,length) 72X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, unsigned char **pp, long length)
77X509_PKEY **a;
78unsigned char **pp;
79long length;
80 { 73 {
81 int i; 74 int i;
82 M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new); 75 M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new);
@@ -91,6 +84,7 @@ long length;
91 if (ret->cipher.cipher == NULL) 84 if (ret->cipher.cipher == NULL)
92 { 85 {
93 c.error=ASN1_R_UNSUPPORTED_CIPHER; 86 c.error=ASN1_R_UNSUPPORTED_CIPHER;
87 c.line=__LINE__;
94 goto err; 88 goto err;
95 } 89 }
96 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) 90 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING)
@@ -99,6 +93,7 @@ long length;
99 if (i > EVP_MAX_IV_LENGTH) 93 if (i > EVP_MAX_IV_LENGTH)
100 { 94 {
101 c.error=ASN1_R_IV_TOO_LARGE; 95 c.error=ASN1_R_IV_TOO_LARGE;
96 c.line=__LINE__;
102 goto err; 97 goto err;
103 } 98 }
104 memcpy(ret->cipher.iv, 99 memcpy(ret->cipher.iv,
@@ -109,9 +104,10 @@ long length;
109 M_ASN1_D2I_Finish(a,X509_PKEY_free,ASN1_F_D2I_X509_PKEY); 104 M_ASN1_D2I_Finish(a,X509_PKEY_free,ASN1_F_D2I_X509_PKEY);
110 } 105 }
111 106
112X509_PKEY *X509_PKEY_new() 107X509_PKEY *X509_PKEY_new(void)
113 { 108 {
114 X509_PKEY *ret=NULL; 109 X509_PKEY *ret=NULL;
110 ASN1_CTX c;
115 111
116 M_ASN1_New_Malloc(ret,X509_PKEY); 112 M_ASN1_New_Malloc(ret,X509_PKEY);
117 ret->version=0; 113 ret->version=0;
@@ -128,8 +124,7 @@ X509_PKEY *X509_PKEY_new()
128 M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW); 124 M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW);
129 } 125 }
130 126
131void X509_PKEY_free(x) 127void X509_PKEY_free(X509_PKEY *x)
132X509_PKEY *x;
133 { 128 {
134 int i; 129 int i;
135 130