summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/x_pkey.c
diff options
context:
space:
mode:
authortedu <>2014-04-18 00:10:08 +0000
committertedu <>2014-04-18 00:10:08 +0000
commit07f5c09b19f56c323fa22ebd5efb5a4df9f5dc4d (patch)
tree6327d50d69a1982f840dc68fe928ea459e2c41e0 /src/lib/libcrypto/asn1/x_pkey.c
parent288a9e368d9d4a72792b12a00ad69e3592d94073 (diff)
downloadopenbsd-07f5c09b19f56c323fa22ebd5efb5a4df9f5dc4d.tar.gz
openbsd-07f5c09b19f56c323fa22ebd5efb5a4df9f5dc4d.tar.bz2
openbsd-07f5c09b19f56c323fa22ebd5efb5a4df9f5dc4d.zip
putting most of the braces in the right column is the very least we can do.
Diffstat (limited to 'src/lib/libcrypto/asn1/x_pkey.c')
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index c37f207e33..37d2d93968 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -65,12 +65,12 @@
65 65
66/* need to implement */ 66/* need to implement */
67int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp) 67int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
68 { 68{
69 return(0); 69 return(0);
70 } 70}
71 71
72X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length) 72X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
73 { 73{
74 int i; 74 int i;
75 M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new); 75 M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new);
76 76
@@ -82,30 +82,30 @@ X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
82 ret->cipher.cipher=EVP_get_cipherbyname( 82 ret->cipher.cipher=EVP_get_cipherbyname(
83 OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm))); 83 OBJ_nid2ln(OBJ_obj2nid(ret->enc_algor->algorithm)));
84 if (ret->cipher.cipher == NULL) 84 if (ret->cipher.cipher == NULL)
85 { 85 {
86 c.error=ASN1_R_UNSUPPORTED_CIPHER; 86 c.error=ASN1_R_UNSUPPORTED_CIPHER;
87 c.line=__LINE__; 87 c.line=__LINE__;
88 goto err; 88 goto err;
89 } 89 }
90 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING) 90 if (ret->enc_algor->parameter->type == V_ASN1_OCTET_STRING)
91 { 91 {
92 i=ret->enc_algor->parameter->value.octet_string->length; 92 i=ret->enc_algor->parameter->value.octet_string->length;
93 if (i > EVP_MAX_IV_LENGTH) 93 if (i > EVP_MAX_IV_LENGTH)
94 { 94 {
95 c.error=ASN1_R_IV_TOO_LARGE; 95 c.error=ASN1_R_IV_TOO_LARGE;
96 c.line=__LINE__; 96 c.line=__LINE__;
97 goto err; 97 goto err;
98 } 98 }
99 memcpy(ret->cipher.iv, 99 memcpy(ret->cipher.iv,
100 ret->enc_algor->parameter->value.octet_string->data,i); 100 ret->enc_algor->parameter->value.octet_string->data,i);
101 } 101 }
102 else 102 else
103 memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH); 103 memset(ret->cipher.iv,0,EVP_MAX_IV_LENGTH);
104 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);
105 } 105}
106 106
107X509_PKEY *X509_PKEY_new(void) 107X509_PKEY *X509_PKEY_new(void)
108 { 108{
109 X509_PKEY *ret=NULL; 109 X509_PKEY *ret=NULL;
110 ASN1_CTX c; 110 ASN1_CTX c;
111 111
@@ -122,10 +122,10 @@ X509_PKEY *X509_PKEY_new(void)
122 ret->references=1; 122 ret->references=1;
123 return(ret); 123 return(ret);
124 M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW); 124 M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW);
125 } 125}
126 126
127void X509_PKEY_free(X509_PKEY *x) 127void X509_PKEY_free(X509_PKEY *x)
128 { 128{
129 int i; 129 int i;
130 130
131 if (x == NULL) return; 131 if (x == NULL) return;
@@ -138,4 +138,4 @@ void X509_PKEY_free(X509_PKEY *x)
138 if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey); 138 if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey);
139 if ((x->key_data != NULL) && (x->key_free)) free(x->key_data); 139 if ((x->key_data != NULL) && (x->key_free)) free(x->key_data);
140 free(x); 140 free(x);
141 } 141}