{ return M_ASN1_INTEGER_new();}
void ASN1_INTEGER_free(ASN1_INTEGER *x)
-{ return M_ASN1_INTEGER_free(x);}
+{ M_ASN1_INTEGER_free(x);}
ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x)
{ return M_ASN1_INTEGER_dup(x);}
goto err;
}
to=s;
- if (*p & 0x80) /* a negative number */
+ if(!len) {
+ /* Strictly speaking this is an illegal INTEGER but we
+ * tolerate it.
+ */
+ ret->type=V_ASN1_INTEGER;
+ } else if (*p & 0x80) /* a negative number */
{
ret->type=V_ASN1_NEG_INTEGER;
if ((*p == 0xff) && (len != 1)) {
goto err;
}
to=s;
- ret->type=V_ASN1_INTEGER;
+ ret->type=V_ASN1_INTEGER;
+ if(len) {
if ((*p == 0) && (len != 1))
{
p++;
}
memcpy(s,p,(int)len);
p+=len;
+ }
if (ret->data != NULL) Free((char *)ret->data);
ret->data=s;