diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/asn1/evp_asn1.c | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/asn1/evp_asn1.c')
-rw-r--r-- | src/lib/libcrypto/asn1/evp_asn1.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/src/lib/libcrypto/asn1/evp_asn1.c b/src/lib/libcrypto/asn1/evp_asn1.c index ebe34a3362..41ced49c19 100644 --- a/src/lib/libcrypto/asn1/evp_asn1.c +++ b/src/lib/libcrypto/asn1/evp_asn1.c | |||
@@ -58,26 +58,22 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "asn1.h" | 61 | #include <openssl/asn1.h> |
62 | #include "asn1_mac.h" | 62 | #include <openssl/asn1_mac.h> |
63 | 63 | ||
64 | int ASN1_TYPE_set_octetstring(a,data,len) | 64 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) |
65 | ASN1_TYPE *a; | ||
66 | unsigned char *data; | ||
67 | int len; | ||
68 | { | 65 | { |
69 | ASN1_STRING *os; | 66 | ASN1_STRING *os; |
70 | 67 | ||
71 | if ((os=ASN1_OCTET_STRING_new()) == NULL) return(0); | 68 | if ((os=ASN1_OCTET_STRING_new()) == NULL) return(0); |
72 | if (!ASN1_OCTET_STRING_set(os,data,len)) return(0); | 69 | if (!ASN1_OCTET_STRING_set(os,data,len)) return(0); |
73 | ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,(char *)os); | 70 | ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os); |
74 | return(1); | 71 | return(1); |
75 | } | 72 | } |
76 | 73 | ||
77 | int ASN1_TYPE_get_octetstring(a,data,max_len) | 74 | /* int max_len: for returned value */ |
78 | ASN1_TYPE *a; | 75 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, |
79 | unsigned char *data; | 76 | int max_len) |
80 | int max_len; /* for returned value */ | ||
81 | { | 77 | { |
82 | int ret,num; | 78 | int ret,num; |
83 | unsigned char *p; | 79 | unsigned char *p; |
@@ -97,11 +93,8 @@ int max_len; /* for returned value */ | |||
97 | return(ret); | 93 | return(ret); |
98 | } | 94 | } |
99 | 95 | ||
100 | int ASN1_TYPE_set_int_octetstring(a,num,data,len) | 96 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, |
101 | ASN1_TYPE *a; | 97 | int len) |
102 | long num; | ||
103 | unsigned char *data; | ||
104 | int len; | ||
105 | { | 98 | { |
106 | int n,size; | 99 | int n,size; |
107 | ASN1_OCTET_STRING os,*osp; | 100 | ASN1_OCTET_STRING os,*osp; |
@@ -131,16 +124,15 @@ int len; | |||
131 | i2d_ASN1_INTEGER(&in,&p); | 124 | i2d_ASN1_INTEGER(&in,&p); |
132 | M_i2d_ASN1_OCTET_STRING(&os,&p); | 125 | M_i2d_ASN1_OCTET_STRING(&os,&p); |
133 | 126 | ||
134 | ASN1_TYPE_set(a,V_ASN1_SEQUENCE,(char *)osp); | 127 | ASN1_TYPE_set(a,V_ASN1_SEQUENCE,osp); |
135 | return(1); | 128 | return(1); |
136 | } | 129 | } |
137 | 130 | ||
138 | /* we return the actual length... */ | 131 | /* we return the actual length..., num may be missing, in which |
139 | int ASN1_TYPE_get_int_octetstring(a,num,data,max_len) | 132 | * case, set it to zero */ |
140 | ASN1_TYPE *a; | 133 | /* int max_len: for returned value */ |
141 | long *num; | 134 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, |
142 | unsigned char *data; | 135 | int max_len) |
143 | int max_len; /* for returned value */ | ||
144 | { | 136 | { |
145 | int ret= -1,n; | 137 | int ret= -1,n; |
146 | ASN1_INTEGER *ai=NULL; | 138 | ASN1_INTEGER *ai=NULL; |