#include <stdio.h>
#include "cryptlib.h"
-#include "asn1.h"
-#include "asn1_mac.h"
+#include <openssl/asn1.h>
+#include <openssl/asn1_mac.h>
-#ifndef NOPROTO
static int asn1_get_length(unsigned char **pp,int *inf,long *rl,int max);
static void asn1_put_length(unsigned char **pp, int length);
-#else
-static int asn1_get_length();
-static void asn1_put_length();
-#endif
-
const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
int ASN1_check_infinite_end(unsigned char **p, long len)
return(ret);
}
-int ASN1_STRING_set(ASN1_STRING *str, unsigned char *data, int len)
+int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
{
- char *c;
+ unsigned char *c;
+ const char *data=_data;
if (len < 0)
{
if (data == NULL)
return(0);
else
- len=strlen((char *)data);
+ len=strlen(data);
}
if ((str->length < len) || (str->data == NULL))
{
- c=(char *)str->data;
+ c=str->data;
if (c == NULL)
- str->data=(unsigned char *)Malloc(len+1);
+ str->data=Malloc(len+1);
else
- str->data=(unsigned char *)Realloc(c,len+1);
+ str->data=Realloc(c,len+1);
if (str->data == NULL)
{
- str->data=(unsigned char *)c;
+ str->data=c;
return(0);
}
}