Set correct type in ASN1_STRING for
INTEGER and ENUMERATED types.
Make ASN1_INTEGER_get() and ASN1_ENUMERATED_get()
return -1 for invalid type rather than 0 (which is
often valid). -1 may also be valid but this is less
likely.
Load OCSP error strings in ERR_load_crypto_strings().
if (i == V_ASN1_NEG_ENUMERATED)
neg=1;
else if (i != V_ASN1_ENUMERATED)
if (i == V_ASN1_NEG_ENUMERATED)
neg=1;
else if (i != V_ASN1_ENUMERATED)
if (a->length > sizeof(long))
{
if (a->length > sizeof(long))
{
return(0xffffffffL);
}
if (a->data == NULL)
return(0xffffffffL);
}
if (a->data == NULL)
for (i=0; i<a->length; i++)
{
for (i=0; i<a->length; i++)
{
if (i == V_ASN1_NEG_INTEGER)
neg=1;
else if (i != V_ASN1_INTEGER)
if (i == V_ASN1_NEG_INTEGER)
neg=1;
else if (i != V_ASN1_INTEGER)
if (a->length > sizeof(long))
{
if (a->length > sizeof(long))
{
return(0xffffffffL);
}
if (a->data == NULL)
return(0xffffffffL);
}
if (a->data == NULL)
for (i=0; i<a->length; i++)
{
for (i=0; i<a->length; i++)
{
ASN1_TYPE *typ = NULL;
int ret = 0;
const ASN1_PRIMITIVE_FUNCS *pf;
ASN1_TYPE *typ = NULL;
int ret = 0;
const ASN1_PRIMITIVE_FUNCS *pf;
pf = it->funcs;
if(pf && pf->prim_c2i) return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
/* If ANY type clear type and set pointer to internal value */
pf = it->funcs;
if(pf && pf->prim_c2i) return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
/* If ANY type clear type and set pointer to internal value */
case V_ASN1_NEG_INTEGER:
case V_ASN1_ENUMERATED:
case V_ASN1_NEG_ENUMERATED:
case V_ASN1_NEG_INTEGER:
case V_ASN1_ENUMERATED:
case V_ASN1_NEG_ENUMERATED:
- if(!c2i_ASN1_INTEGER((ASN1_INTEGER **)pval, &cont, len)) goto err;
+ tint = (ASN1_INTEGER **)pval;
+ if(!c2i_ASN1_INTEGER(tint, &cont, len)) goto err;
+ /* Fixup type to match the expected form */
+ (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
break;
case V_ASN1_OCTET_STRING:
break;
case V_ASN1_OCTET_STRING:
#include <openssl/rand.h>
#include <openssl/dso.h>
#include <openssl/engine.h>
#include <openssl/rand.h>
#include <openssl/dso.h>
#include <openssl/engine.h>
+#include <openssl/ocsp.h>
#include <openssl/err.h>
void ERR_load_crypto_strings(void)
#include <openssl/err.h>
void ERR_load_crypto_strings(void)
ERR_load_RAND_strings();
ERR_load_DSO_strings();
ERR_load_ENGINE_strings();
ERR_load_RAND_strings();
ERR_load_DSO_strings();
ERR_load_ENGINE_strings();
+ ERR_load_OCSP_strings();
static int i2d_ocsp_nonce(void *a, unsigned char **pp)
{
ASN1_OCTET_STRING *os = a;
static int i2d_ocsp_nonce(void *a, unsigned char **pp)
{
ASN1_OCTET_STRING *os = a;
memcpy(*pp, os->data, os->length);
*pp += os->length;
}
memcpy(*pp, os->data, os->length);
*pp += os->length;
}