Latest update.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "internal/numbers.h"
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
|
||||
#ifndef NO_OLD_ASN1
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <time.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/* This is the primary function used to parse ASN1_GENERALIZEDTIME */
|
||||
int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#include <limits.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/bn.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/bn.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "asn1_locl.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/buffer.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
#ifndef NO_ASN1_OLD
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
@@ -51,7 +51,7 @@ int ASN1_STRING_set_default_mask_asc(const char *p)
|
||||
char *end;
|
||||
|
||||
if (strncmp(p, "MASK:", 5) == 0) {
|
||||
if (!p[5])
|
||||
if (p[5] == '\0')
|
||||
return 0;
|
||||
mask = strtoul(p + 5, &end, 0);
|
||||
if (*end)
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
int ASN1_TYPE_get(const ASN1_TYPE *a)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <time.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/* This is the primary function used to parse ASN1_UTCTIME */
|
||||
int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/evp.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
#ifndef NO_ASN1_OLD
|
||||
|
||||
@@ -116,7 +116,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
goto err;
|
||||
}
|
||||
if (mdnid == NID_undef) {
|
||||
if (!pkey->ameth || !pkey->ameth->item_verify) {
|
||||
if (pkey->ameth == NULL || pkey->ameth->item_verify == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
|
||||
ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
|
||||
goto err;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/engine.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
#include "standard_methods.h"
|
||||
|
||||
@@ -56,6 +56,7 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
|
||||
{
|
||||
EVP_PKEY_ASN1_METHOD tmp;
|
||||
const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
|
||||
|
||||
tmp.pkey_id = type;
|
||||
if (app_methods) {
|
||||
int idx;
|
||||
@@ -64,7 +65,7 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
|
||||
return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
|
||||
}
|
||||
ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
|
||||
if (!ret || !*ret)
|
||||
if (ret == NULL || *ret == NULL)
|
||||
return NULL;
|
||||
return *ret;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <limits.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
|
||||
long max);
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/evp.h"
|
||||
#include "internal/bio.h"
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/*
|
||||
* Generalised MIME like utilities for streaming ASN1. Although many have a
|
||||
@@ -399,7 +399,7 @@ ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
|
||||
if (strcmp(hdr->value, "multipart/signed") == 0) {
|
||||
/* Split into two parts */
|
||||
prm = mime_param_find(hdr, "boundary");
|
||||
if (!prm || !prm->param_value) {
|
||||
if (prm == NULL || prm->param_value == NULL) {
|
||||
sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
|
||||
ASN1err(ASN1_F_SMIME_READ_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY);
|
||||
return NULL;
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/x509.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/objects.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/objects.h"
|
||||
|
||||
/* Simple ASN1 OID module: add all objects in a given section */
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
unsigned char *p;
|
||||
int derlen;
|
||||
|
||||
if (!parg)
|
||||
if (parg == NULL)
|
||||
return 0;
|
||||
|
||||
ndef_aux = *(NDEF_SUPPORT **)parg;
|
||||
@@ -123,7 +123,7 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
*pbuf = p;
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
|
||||
|
||||
if (!*ndef_aux->boundary)
|
||||
if (*ndef_aux->boundary == NULL)
|
||||
return 0;
|
||||
|
||||
*plen = *ndef_aux->boundary - *pbuf;
|
||||
@@ -136,7 +136,7 @@ static int ndef_prefix_free(BIO *b, unsigned char **pbuf, int *plen,
|
||||
{
|
||||
NDEF_SUPPORT *ndef_aux;
|
||||
|
||||
if (!parg)
|
||||
if (parg == NULL)
|
||||
return 0;
|
||||
|
||||
ndef_aux = *(NDEF_SUPPORT **)parg;
|
||||
@@ -168,7 +168,7 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
const ASN1_AUX *aux;
|
||||
ASN1_STREAM_ARG sarg;
|
||||
|
||||
if (!parg)
|
||||
if (parg == NULL)
|
||||
return 0;
|
||||
|
||||
ndef_aux = *(NDEF_SUPPORT **)parg;
|
||||
@@ -195,7 +195,7 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
|
||||
*pbuf = p;
|
||||
derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
|
||||
|
||||
if (!*ndef_aux->boundary)
|
||||
if (*ndef_aux->boundary == NULL)
|
||||
return 0;
|
||||
*pbuf = *ndef_aux->boundary;
|
||||
*plen = derlen - (*ndef_aux->boundary - ndef_aux->derbuf);
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include "internal/evp_int.h"
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/evp.h"
|
||||
#include "crypto/asn1.h"
|
||||
|
||||
EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
long length)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
long length)
|
||||
@@ -48,7 +48,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
EVP_PKEY *tmp;
|
||||
PKCS8_PRIV_KEY_INFO *p8 = NULL;
|
||||
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
|
||||
if (!p8)
|
||||
if (p8 == NULL)
|
||||
goto err;
|
||||
tmp = EVP_PKCS82PKEY(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
@@ -104,7 +104,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
|
||||
EVP_PKEY *ret;
|
||||
|
||||
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
|
||||
if (!p8) {
|
||||
if (p8 == NULL) {
|
||||
ASN1err(ASN1_F_D2I_AUTOPRIVATEKEY,
|
||||
ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
|
||||
return NULL;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/ec.h>
|
||||
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
long length)
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/ctype.h"
|
||||
#include "crypto/ctype.h"
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
int i2d_KeyParams(const EVP_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
|
||||
|
||||
pbe2->keyfunc = PKCS5_pbkdf2_set(iter, salt, saltlen, prf_nid, keylen);
|
||||
|
||||
if (!pbe2->keyfunc)
|
||||
if (pbe2->keyfunc == NULL)
|
||||
goto merr;
|
||||
|
||||
/* Now set up top level AlgorithmIdentifier */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/x509.h>
|
||||
#include "internal/x509_int.h"
|
||||
#include "crypto/x509.h"
|
||||
|
||||
/* Minor tweak to operation: zero private key data */
|
||||
static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/buffer.h>
|
||||
#include "internal/bn_int.h"
|
||||
#include "crypto/bn.h"
|
||||
|
||||
/* Number of octets per line */
|
||||
#define ASN1_BUF_PRINT_WIDTH 15
|
||||
|
||||
@@ -30,7 +30,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
|
||||
BIO_printf(out, " Public Key Algorithm: %s\n",
|
||||
(i == NID_undef) ? "UNKNOWN" : OBJ_nid2ln(i));
|
||||
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
|
||||
if (!pkey)
|
||||
if (pkey == NULL)
|
||||
BIO_printf(out, " Unable to load public key\n");
|
||||
else {
|
||||
EVP_PKEY_print_public(out, pkey, 4, NULL);
|
||||
|
||||
+14
-10
@@ -15,7 +15,7 @@
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/err.h>
|
||||
#include "internal/numbers.h"
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -108,7 +108,8 @@ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
|
||||
{
|
||||
ASN1_TLC c;
|
||||
ASN1_VALUE *ptmpval = NULL;
|
||||
if (!pval)
|
||||
|
||||
if (pval == NULL)
|
||||
pval = &ptmpval;
|
||||
asn1_tlc_clear_nc(&c);
|
||||
if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
|
||||
@@ -149,7 +150,8 @@ static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
|
||||
int otag;
|
||||
int ret = 0;
|
||||
ASN1_VALUE **pchptr;
|
||||
if (!pval)
|
||||
|
||||
if (pval == NULL)
|
||||
return 0;
|
||||
if (aux && aux->asn1_cb)
|
||||
asn1_cb = aux->asn1_cb;
|
||||
@@ -303,7 +305,7 @@ static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!*pval && !ASN1_item_ex_new(pval, it)) {
|
||||
if (*pval == NULL && !ASN1_item_ex_new(pval, it)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_EMBED_D2I, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
}
|
||||
@@ -554,7 +556,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
|
||||
return 0;
|
||||
} else if (ret == -1)
|
||||
return -1;
|
||||
if (!*val)
|
||||
if (*val == NULL)
|
||||
*val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
|
||||
else {
|
||||
/*
|
||||
@@ -568,7 +570,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
|
||||
}
|
||||
}
|
||||
|
||||
if (!*val) {
|
||||
if (*val == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
@@ -649,7 +651,8 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
|
||||
BUF_MEM buf = { 0, NULL, 0, 0 };
|
||||
const unsigned char *cont = NULL;
|
||||
long len;
|
||||
if (!pval) {
|
||||
|
||||
if (pval == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_NULL);
|
||||
return 0; /* Should never happen */
|
||||
}
|
||||
@@ -786,7 +789,7 @@ static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
|
||||
/* If ANY type clear type and set pointer to internal value */
|
||||
if (it->utype == V_ASN1_ANY) {
|
||||
if (!*pval) {
|
||||
if (*pval == NULL) {
|
||||
typ = ASN1_TYPE_new();
|
||||
if (typ == NULL)
|
||||
goto err;
|
||||
@@ -866,7 +869,7 @@ static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
goto err;
|
||||
}
|
||||
/* All based on ASN1_STRING and handled the same */
|
||||
if (!*pval) {
|
||||
if (*pval == NULL) {
|
||||
stmp = ASN1_STRING_type_new(utype);
|
||||
if (stmp == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_EX_C2I, ERR_R_MALLOC_FAILURE);
|
||||
@@ -1058,10 +1061,11 @@ static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen)
|
||||
static int asn1_check_eoc(const unsigned char **in, long len)
|
||||
{
|
||||
const unsigned char *p;
|
||||
|
||||
if (len < 2)
|
||||
return 0;
|
||||
p = *in;
|
||||
if (!p[0] && !p[1]) {
|
||||
if (p[0] == '\0' && p[1] == '\0') {
|
||||
*in += 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "asn1_locl.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
static int asn1_i2d_ex_primitive(const ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_ITEM *it, int tag, int aclass);
|
||||
@@ -55,7 +55,7 @@ int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *i
|
||||
static int asn1_item_flags_i2d(const ASN1_VALUE *val, unsigned char **out,
|
||||
const ASN1_ITEM *it, int flags)
|
||||
{
|
||||
if (out && !*out) {
|
||||
if (out != NULL && *out == NULL) {
|
||||
unsigned char *p, *buf;
|
||||
int len;
|
||||
|
||||
@@ -89,7 +89,7 @@ int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_AUX *aux = it->funcs;
|
||||
ASN1_aux_const_cb *asn1_cb = NULL;
|
||||
|
||||
if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval)
|
||||
if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
|
||||
return 0;
|
||||
|
||||
if (aux != NULL) {
|
||||
@@ -258,7 +258,7 @@ static int asn1_template_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
||||
int skcontlen, sklen;
|
||||
const ASN1_VALUE *skitem;
|
||||
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return 0;
|
||||
|
||||
if (flags & ASN1_TFLG_SET_OF) {
|
||||
@@ -510,7 +510,7 @@ static int asn1_ex_i2c(const ASN1_VALUE **pval, unsigned char *cout, int *putype
|
||||
/* Should type be omitted? */
|
||||
if ((it->itype != ASN1_ITYPE_PRIMITIVE)
|
||||
|| (it->utype != V_ASN1_BOOLEAN)) {
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/* Free up an ASN1 structure */
|
||||
|
||||
@@ -33,9 +33,9 @@ void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
|
||||
ASN1_aux_cb *asn1_cb;
|
||||
int i;
|
||||
|
||||
if (!pval)
|
||||
if (pval == NULL)
|
||||
return;
|
||||
if ((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval)
|
||||
if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
|
||||
return;
|
||||
if (aux && aux->asn1_cb)
|
||||
asn1_cb = aux->asn1_cb;
|
||||
@@ -168,15 +168,15 @@ void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)
|
||||
|
||||
utype = typ->type;
|
||||
pval = &typ->value.asn1_value;
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return;
|
||||
} else if (it->itype == ASN1_ITYPE_MSTRING) {
|
||||
utype = -1;
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return;
|
||||
} else {
|
||||
utype = it->utype;
|
||||
if ((utype != V_ASN1_BOOLEAN) && !*pval)
|
||||
if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include <string.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
int embed);
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "asn1_locl.h"
|
||||
#include "crypto/asn1.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/*
|
||||
* Print routines.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/*
|
||||
* General ASN1 structure recursive scanner: iterate through all fields
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/err.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/* Utility functions for manipulating fields and offsets */
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
ASN1_SEQUENCE(X509_ALGOR) = {
|
||||
ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT),
|
||||
|
||||
@@ -82,7 +82,7 @@ static int bn_secure_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
|
||||
static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
||||
{
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return;
|
||||
if (it->size & BN_SENSITIVE)
|
||||
BN_clear_free((BIGNUM *)*pval);
|
||||
@@ -96,7 +96,7 @@ static int bn_i2c(const ASN1_VALUE **pval, unsigned char *cont, int *putype,
|
||||
{
|
||||
BIGNUM *bn;
|
||||
int pad;
|
||||
if (!*pval)
|
||||
if (*pval == NULL)
|
||||
return -1;
|
||||
bn = (BIGNUM *)*pval;
|
||||
/* If MSB set in an octet we need a padding byte */
|
||||
@@ -133,7 +133,7 @@ static int bn_secure_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
int ret;
|
||||
BIGNUM *bn;
|
||||
|
||||
if (!*pval && !bn_secure_new(pval, it))
|
||||
if (*pval == NULL && !bn_secure_new(pval, it))
|
||||
return 0;
|
||||
|
||||
ret = bn_c2i(pval, cont, len, utype, free_cont, it);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "internal/numbers.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/bn.h>
|
||||
#include "asn1_locl.h"
|
||||
#include "asn1_local.h"
|
||||
|
||||
/*
|
||||
* Custom primitive types for handling int32_t, int64_t, uint32_t, uint64_t.
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/x509.h>
|
||||
#include "internal/x509_int.h"
|
||||
#include "crypto/x509.h"
|
||||
|
||||
ASN1_SEQUENCE(X509_SIG) = {
|
||||
ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR),
|
||||
|
||||
Reference in New Issue
Block a user