Latest update.

This commit is contained in:
2019-10-17 23:54:38 +09:00
parent 41a23ae6f6
commit ee84d0dd84
1357 changed files with 41111 additions and 9603 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
#include <stdlib.h>
#include <openssl/crypto.h>
#include <openssl/aes.h>
#include "aes_locl.h"
#include "aes_local.h"
#ifndef AES_ASM
/*-
+1 -1
View File
@@ -10,7 +10,7 @@
#include <assert.h>
#include <openssl/aes.h>
#include "aes_locl.h"
#include "aes_local.h"
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key, const int enc)
+1 -1
View File
@@ -14,7 +14,7 @@ NON_EMPTY_TRANSLATION_UNIT
#else
#include <openssl/aes.h>
#include "aes_locl.h"
#include "aes_local.h"
#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long))
typedef struct {
@@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_AES_LOCL_H
# define HEADER_AES_LOCL_H
#ifndef OSSL_CRYPTO_AES_LOCAL_H
# define OSSL_CRYPTO_AES_LOCAL_H
# include <openssl/e_os2.h>
# include <stdio.h>
@@ -39,4 +39,4 @@ typedef unsigned char u8;
/* This controls loop-unrolling in aes_core.c */
# undef FULL_UNROLL
#endif /* !HEADER_AES_LOCL_H */
#endif /* !OSSL_CRYPTO_AES_LOCAL_H */
+1 -1
View File
@@ -9,7 +9,7 @@
#include <openssl/opensslv.h>
#include <openssl/aes.h>
#include "aes_locl.h"
#include "aes_local.h"
const char *AES_options(void)
{
+1 -1
View File
@@ -46,7 +46,7 @@
#include <stdlib.h>
#include <openssl/aes.h>
#include "aes_locl.h"
#include "aes_local.h"
/*
* These two parameters control which table, 256-byte or 2KB, is
+7 -1
View File
@@ -61,8 +61,14 @@ ENDIF
$COMMON=aes_misc.c aes_ecb.c $AESASM
SOURCE[../../libcrypto]=$COMMON aes_cfb.c aes_ofb.c aes_ige.c aes_wrap.c
SOURCE[../../providers/libfips.a]=$COMMON
# Implementations are now spread across several libraries, so the defines
# need to be applied to all affected libraries and modules.
DEFINE[../../libcrypto]=$AESDEF
SOURCE[../../providers/fips]=$COMMON
DEFINE[../../providers/libfips.a]=$AESDEF
DEFINE[../../providers/libimplementations.a]=$AESDEF
# fipsprov.c needs access to AESNI.
DEFINE[../../providers/fips]=$AESDEF
GENERATE[aes-ia64.s]=asm/aes-ia64.S
+1 -1
View File
@@ -19,7 +19,7 @@
*/
#include <openssl/e_os2.h>
#include "internal/aria.h"
#include "crypto/aria.h"
#include <assert.h>
#include <string.h>
+2 -2
View File
@@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/
#ifndef __ARM_ARCH_H__
# define __ARM_ARCH_H__
#ifndef OSSL_CRYPTO_ARM_ARCH_H
# define OSSL_CRYPTO_ARM_ARCH_H
# if !defined(__ARM_ARCH__)
# if defined(__CC_ARM)
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
View File
@@ -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)
{
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <stdio.h>
#include "internal/ctype.h"
#include "crypto/ctype.h"
#include "internal/cryptlib.h"
#include <openssl/asn1.h>
+3 -3
View File
@@ -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)
{
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <stdio.h>
#include "internal/ctype.h"
#include "crypto/ctype.h"
#include "internal/cryptlib.h"
#include <openssl/asn1.h>
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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;
+4 -3
View File
@@ -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;
}
+1 -1
View File
@@ -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);
+4 -4
View File
@@ -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;
+3 -3
View File
@@ -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 */
+5 -5
View File
@@ -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);
+2 -2
View File
@@ -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)
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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>
+1 -1
View File
@@ -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>
+2 -2
View File
@@ -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)
{
+2 -2
View File
@@ -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)
{
+1 -1
View File
@@ -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 */
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
View File
@@ -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;
}
+6 -6
View File
@@ -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;
}
+6 -6
View File
@@ -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;
}
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 */
+1 -1
View File
@@ -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),
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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
View File
@@ -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),
+1 -1
View File
@@ -23,7 +23,7 @@
#include <openssl/crypto.h>
#include <openssl/bn.h>
#include "internal/asn1_dsa.h"
#include "crypto/asn1_dsa.h"
#include "internal/packet.h"
#define ID_SEQUENCE 0x30
+1 -1
View File
@@ -8,7 +8,7 @@
*/
/* This must be the first #include file */
#include "../async_locl.h"
#include "../async_local.h"
#ifdef ASYNC_NULL
int ASYNC_is_capable(void)
+1 -1
View File
@@ -8,7 +8,7 @@
*/
/* This must be the first #include file */
#include "../async_locl.h"
#include "../async_local.h"
#ifdef ASYNC_POSIX
+3 -3
View File
@@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/
#ifndef OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
#define OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
#ifndef OSSL_CRYPTO_ASYNC_POSIX_H
#define OSSL_CRYPTO_ASYNC_POSIX_H
#include <openssl/e_os2.h>
#if defined(OPENSSL_SYS_UNIX) \
@@ -55,4 +55,4 @@ void async_fibre_free(async_fibre *fibre);
# endif
#endif
#endif /* OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H */
#endif /* OSSL_CRYPTO_ASYNC_POSIX_H */
+1 -1
View File
@@ -8,7 +8,7 @@
*/
/* This must be the first #include file */
#include "../async_locl.h"
#include "../async_local.h"
#ifdef ASYNC_WIN
+3 -3
View File
@@ -16,10 +16,10 @@
#undef _FORTIFY_SOURCE
/* This must be the first #include file */
#include "async_locl.h"
#include "async_local.h"
#include <openssl/err.h>
#include "internal/cryptlib_int.h"
#include "crypto/cryptlib.h"
#include <string.h>
#define ASYNC_JOB_RUNNING 0
@@ -287,7 +287,7 @@ static void async_empty_pool(async_pool *pool)
{
ASYNC_JOB *job;
if (!pool || !pool->jobs)
if (pool == NULL || pool->jobs == NULL)
return;
do {
@@ -20,7 +20,7 @@
# include <windows.h>
#endif
#include "internal/async.h"
#include "crypto/async.h"
#include <openssl/crypto.h>
typedef struct async_ctx_st async_ctx;
+1 -1
View File
@@ -8,7 +8,7 @@
*/
/* This must be the first #include file */
#include "async_locl.h"
#include "async_local.h"
#include <openssl/err.h>
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <openssl/blowfish.h>
#include "bf_locl.h"
#include "bf_local.h"
/*
* The input and output encrypted as though 64bit cfb mode is being used.
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <openssl/blowfish.h>
#include "bf_locl.h"
#include "bf_local.h"
#include <openssl/opensslv.h>
/*
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <openssl/blowfish.h>
#include "bf_locl.h"
#include "bf_local.h"
/*
* Blowfish as implemented from 'Blowfish: Springer-Verlag paper' (From
+2 -2
View File
@@ -7,8 +7,8 @@
* https://www.openssl.org/source/license.html
*/
#ifndef HEADER_BF_LOCL_H
# define HEADER_BF_LOCL_H
#ifndef OSSL_CRYPTO_BF_LOCAL_H
# define OSSL_CRYPTO_BF_LOCAL_H
# include <openssl/opensslconf.h>
/* NOTE - c is not incremented as per n2l */
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include <openssl/blowfish.h>
#include "bf_locl.h"
#include "bf_local.h"
/*
* The input and output encrypted as though 64bit ofb mode is being used.
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <string.h>
#include <openssl/blowfish.h>
#include "bf_locl.h"
#include "bf_local.h"
#include "bf_pi.h"
void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
+5 -3
View File
@@ -10,7 +10,7 @@
#include <assert.h>
#include <string.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include <openssl/crypto.h>
#ifndef OPENSSL_NO_SOCK
@@ -22,7 +22,7 @@ CRYPTO_RWLOCK *bio_lookup_lock;
static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;
/*
* Throughout this file and bio_lcl.h, the existence of the macro
* Throughout this file and bio_local.h, the existence of the macro
* AI_PASSIVE is used to detect the availability of struct addrinfo,
* getnameinfo() and getaddrinfo(). If that macro doesn't exist,
* we use our own implementation instead, using gethostbyname,
@@ -695,9 +695,11 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
hints.ai_flags |= AI_PASSIVE;
/* Note that |res| SHOULD be a 'struct addrinfo **' thanks to
* macro magic in bio_lcl.h
* macro magic in bio_local.h
*/
# if defined(AI_ADDRCONFIG) && defined(AI_NUMERICHOST)
retry:
# endif
switch ((gai_ret = getaddrinfo(host, service, &hints, res))) {
# ifdef EAI_SYSTEM
case EAI_SYSTEM:
+1 -1
View File
@@ -12,7 +12,7 @@
*/
#include <stdio.h>
#include "bio_lcl.h"
#include "bio_local.h"
#define DUMP_WIDTH 16
#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <string.h>
#include "internal/cryptlib.h"
#include "internal/ctype.h"
#include "crypto/ctype.h"
#include "internal/numbers.h"
#include <openssl/bio.h>
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#ifndef OPENSSL_NO_SOCK
# define SOCKET_PROTOCOL IPPROTO_TCP
# ifdef SO_MAXCONN
+1 -1
View File
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include <openssl/err.h>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
static int buffer_write(BIO *h, const char *buf, int num);
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
#include <openssl/evp.h>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
#include <openssl/rand.h>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
/*
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
#include <openssl/err.h>
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <errno.h>
#include <openssl/crypto.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
@@ -27,11 +27,11 @@
* For clarity, we check for internal/cryptlib.h since it's a common header
* that also includes bio.h.
*/
# ifdef HEADER_CRYPTLIB_H
# error internal/cryptlib.h included before bio_lcl.h
# ifdef OSSL_INTERNAL_CRYPTLIB_H
# error internal/cryptlib.h included before bio_local.h
# endif
# ifdef HEADER_BIO_H
# error openssl/bio.h included before bio_lcl.h
# ifdef OPENSSL_BIO_H
# error openssl/bio.h included before bio_local.h
# endif
/*
+1 -1
View File
@@ -7,7 +7,7 @@
* https://www.openssl.org/source/license.html
*/
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/thread_once.h"
CRYPTO_RWLOCK *bio_type_lock = NULL;
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#ifndef OPENSSL_NO_SOCK
+1 -1
View File
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include <openssl/err.h>
#include <openssl/crypto.h>
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#ifndef OPENSSL_NO_SOCK
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#ifndef OPENSSL_NO_DGRAM
# ifndef OPENSSL_NO_SCTP
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#if defined(OPENSSL_NO_POSIX_IO)
/*
+1 -1
View File
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include <openssl/err.h>
#if !defined(OPENSSL_NO_STDIO)
+1 -1
View File
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
#if defined(OPENSSL_SYS_WINCE)
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
static int mem_write(BIO *h, const char *buf, int num);
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
static int null_write(BIO *h, const char *buf, int num);
+1 -1
View File
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "bio_local.h"
#include "internal/cryptlib.h"
#include "internal/ktls.h"
+2 -2
View File
@@ -11,8 +11,8 @@
# include <stddef.h>
# include <openssl/obj_mac.h>
# include "internal/evp_int.h"
# include "internal/blake2.h"
# include "crypto/evp.h"
# include "prov/blake2.h"
static int init(EVP_MD_CTX *ctx)
{
+2 -2
View File
@@ -11,8 +11,8 @@
# include <stddef.h>
# include <openssl/obj_mac.h>
# include "internal/evp_int.h"
# include "internal/blake2.h"
# include "crypto/evp.h"
# include "prov/blake2.h"
static int init(EVP_MD_CTX *ctx)
{
+1 -1
View File
@@ -188,7 +188,7 @@ B<a> and the 2*B<n> word arrays B<tmp> and B<r>.
The implementations use the following macros which, depending on the
architecture, may use "long long" C operations or inline assembler.
They are defined in C<bn_lcl.h>.
They are defined in C<bn_local.h>.
mul(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<c> and places the
low word of the result in B<r> and the high word in B<c>.
+1 -1
View File
@@ -7,7 +7,7 @@
* https://www.openssl.org/source/license.html
*/
#include "../bn_lcl.h"
#include "../bn_local.h"
#if !(defined(__GNUC__) && __GNUC__>=2)
# include "../bn_asm.c" /* kind of dirty hack for Sun Studio */
#else
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "internal/cryptlib.h"
#include "bn_lcl.h"
#include "bn_local.h"
/* signed add of b to a. */
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
+1 -1
View File
@@ -10,7 +10,7 @@
#include <assert.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "bn_lcl.h"
#include "bn_local.h"
#if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
+1 -1
View File
@@ -9,7 +9,7 @@
#include <openssl/opensslconf.h>
#include "internal/cryptlib.h"
#include "bn_lcl.h"
#include "bn_local.h"
#define BN_BLINDING_COUNTER 32
+2 -2
View File
@@ -8,8 +8,8 @@
*/
#include <openssl/err.h>
#include "internal/ctype.h"
#include "bn_lcl.h"
#include "crypto/ctype.h"
#include "bn_local.h"
static const char Hex[] = "0123456789ABCDEF";
+1 -1
View File
@@ -9,7 +9,7 @@
#include <openssl/trace.h>
#include "internal/cryptlib.h"
#include "bn_lcl.h"
#include "bn_local.h"
/*-
* TODO list
+4 -4
View File
@@ -20,7 +20,7 @@ NON_EMPTY_TRANSLATION_UNIT
# include <stdio.h>
# include <time.h>
# include "internal/cryptlib.h"
# include "bn_lcl.h"
# include "bn_local.h"
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
const BIGNUM *add, const BIGNUM *rem,
@@ -52,7 +52,7 @@ int BN_is_prime(const BIGNUM *a, int checks,
{
BN_GENCB cb;
BN_GENCB_set_old(&cb, callback, cb_arg);
return BN_is_prime_ex(a, checks, ctx_passed, &cb);
return bn_check_prime_int(a, checks, ctx_passed, 0, &cb);
}
int BN_is_prime_fasttest(const BIGNUM *a, int checks,
@@ -62,7 +62,7 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
{
BN_GENCB cb;
BN_GENCB_set_old(&cb, callback, cb_arg);
return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
do_trial_division, &cb);
return bn_check_prime_int(a, checks, ctx_passed, do_trial_division, &cb);
}
#endif
+2 -2
View File
@@ -7,12 +7,12 @@
* https://www.openssl.org/source/license.html
*/
#include "bn_lcl.h"
#include "bn_local.h"
#include "internal/nelem.h"
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#include "internal/bn_dh.h"
#include "crypto/bn_dh.h"
/* DH parameters from RFC5114 */
# if BN_BITS2 == 64
+1 -1
View File
@@ -10,7 +10,7 @@
#include <assert.h>
#include <openssl/bn.h>
#include "internal/cryptlib.h"
#include "bn_lcl.h"
#include "bn_local.h"
/* The old slow way */
#if 0

Some files were not shown because too many files have changed in this diff Show More