summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_bitstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bitstr.c')
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index 38ea802be8..c77456b315 100644
--- a/src/lib/libcrypto/asn1/a_bitstr.c
+++ b/src/lib/libcrypto/asn1/a_bitstr.c
@@ -60,6 +60,15 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62 62
63ASN1_BIT_STRING *ASN1_BIT_STRING_new(void)
64{ return M_ASN1_BIT_STRING_new(); }
65
66void ASN1_BIT_STRING_free(ASN1_BIT_STRING *x)
67{ M_ASN1_BIT_STRING_free(x); }
68
69int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
70{ return M_ASN1_BIT_STRING_set(x, d, len); }
71
63int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) 72int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
64 { 73 {
65 int ret,j,r,bits,len; 74 int ret,j,r,bits,len;
@@ -121,7 +130,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
121 130
122 if ((a == NULL) || ((*a) == NULL)) 131 if ((a == NULL) || ((*a) == NULL))
123 { 132 {
124 if ((ret=ASN1_BIT_STRING_new()) == NULL) return(NULL); 133 if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
125 } 134 }
126 else 135 else
127 ret=(*a); 136 ret=(*a);
@@ -164,7 +173,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
164 s=NULL; 173 s=NULL;
165 174
166 ret->length=(int)len; 175 ret->length=(int)len;
167 if (ret->data != NULL) Free((char *)ret->data); 176 if (ret->data != NULL) Free(ret->data);
168 ret->data=s; 177 ret->data=s;
169 ret->type=V_ASN1_BIT_STRING; 178 ret->type=V_ASN1_BIT_STRING;
170 if (a != NULL) (*a)=ret; 179 if (a != NULL) (*a)=ret;
@@ -173,7 +182,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
173err: 182err:
174 ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i); 183 ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i);
175 if ((ret != NULL) && ((a == NULL) || (*a != ret))) 184 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
176 ASN1_BIT_STRING_free(ret); 185 M_ASN1_BIT_STRING_free(ret);
177 return(NULL); 186 return(NULL);
178 } 187 }
179 188