that open brace { should be on the previous line

Found by running the checkpatch.pl Linux script to enforce coding style.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22097)
This commit is contained in:
Dimitri Papadopoulos 2023-09-13 20:32:54 +02:00 committed by Neil Horman
parent 1cf2f8231e
commit 962431d58b
45 changed files with 189 additions and 178 deletions

View File

@ -706,12 +706,11 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt)
cp = out_buf + strlen(out_buf); cp = out_buf + strlen(out_buf);
*cp++ = ascii_dollar[0]; *cp++ = ascii_dollar[0];
# define b64_from_24bit(B2, B1, B0, N) \ # define b64_from_24bit(B2, B1, B0, N) \
do { \ do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \ unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int i = (N); \ int i = (N); \
while (i-- > 0) \ while (i-- > 0) { \
{ \
*cp++ = cov_2char[w & 0x3f]; \ *cp++ = cov_2char[w & 0x3f]; \
w >>= 6; \ w >>= 6; \
} \ } \

View File

@ -1257,8 +1257,7 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst,
} }
if (X509_ATTRIBUTE_count(attr)) { if (X509_ATTRIBUTE_count(attr)) {
for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) {
{
av = X509_ATTRIBUTE_get0_type(attr, j); av = X509_ATTRIBUTE_get0_type(attr, j);
print_attribute(out, av); print_attribute(out, av);
} }

View File

@ -4768,8 +4768,9 @@ static int do_multi(int multi, int size_num)
static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single, static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
const openssl_speed_sec_t *seconds) const openssl_speed_sec_t *seconds)
{ {
static const int mblengths_list[] = static const int mblengths_list[] = {
{ 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024 }; 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024
};
const int *mblengths = mblengths_list; const int *mblengths = mblengths_list;
int j, count, keylen, num = OSSL_NELEM(mblengths_list), ciph_success = 1; int j, count, keylen, num = OSSL_NELEM(mblengths_list), ciph_success = 1;
const char *alg_name; const char *alg_name;

View File

@ -76,8 +76,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
again = (buf[i - 1] == '\\'); again = (buf[i - 1] == '\\');
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {
if (!ossl_isxdigit(buf[j])) if (!ossl_isxdigit(buf[j])) {
{
i = j; i = j;
break; break;
} }

View File

@ -774,16 +774,19 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
/* Windows doesn't seem to have in_addr_t */ /* Windows doesn't seem to have in_addr_t */
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
static uint32_t he_fallback_address; static uint32_t he_fallback_address;
static const char *he_fallback_addresses[] = static const char *he_fallback_addresses[] = {
{ (char *)&he_fallback_address, NULL }; (char *)&he_fallback_address, NULL
};
#else #else
static in_addr_t he_fallback_address; static in_addr_t he_fallback_address;
static const char *he_fallback_addresses[] = static const char *he_fallback_addresses[] = {
{ (char *)&he_fallback_address, NULL }; (char *)&he_fallback_address, NULL
};
#endif #endif
static const struct hostent he_fallback = static const struct hostent he_fallback = {
{ NULL, NULL, AF_INET, sizeof(he_fallback_address), NULL, NULL, AF_INET, sizeof(he_fallback_address),
(char **)&he_fallback_addresses }; (char **)&he_fallback_addresses
};
#if defined(OPENSSL_SYS_VMS) && defined(__DECC) #if defined(OPENSSL_SYS_VMS) && defined(__DECC)
# pragma pointer_size restore # pragma pointer_size restore
#endif #endif

View File

@ -82,8 +82,9 @@ int BN_get_params(int which)
const BIGNUM *BN_value_one(void) const BIGNUM *BN_value_one(void)
{ {
static const BN_ULONG data_one = 1L; static const BN_ULONG data_one = 1L;
static const BIGNUM const_one = static const BIGNUM const_one = {
{ (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
};
return &const_one; return &const_one;
} }

View File

@ -84,8 +84,8 @@ static const BN_ULONG _nist_p_384_sqr[] = {
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL
}; };
static const BN_ULONG _nist_p_521[] = static const BN_ULONG _nist_p_521[] = {
{ 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,

View File

@ -324,8 +324,9 @@ int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule)
void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
{ {
static const int shifts2[16] = static const int shifts2[16] = {
{ 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0 }; 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0
};
register DES_LONG c, d, t, s, t2; register DES_LONG c, d, t, s, t2;
register const unsigned char *in; register const unsigned char *in;
register DES_LONG *k; register DES_LONG *k;

View File

@ -55,8 +55,9 @@ static void gf_invert(gf y, const gf x, int assert_nonzero)
} }
/** identity = (0,1) */ /** identity = (0,1) */
const curve448_point_t ossl_curve448_point_identity = const curve448_point_t ossl_curve448_point_identity = {
{ {{{{0}}}, {{{1}}}, {{{1}}}, {{{0}}}} }; {{{{0}}}, {{{1}}}, {{{1}}}, {{{0}}}}
};
static void point_double_internal(curve448_point_t p, const curve448_point_t q, static void point_double_internal(curve448_point_t p, const curve448_point_t q,
int before_double) int before_double)

View File

@ -184,8 +184,7 @@ static int ec_group_explicit_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P); param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A); param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B); param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) {
{
BIGNUM *p = BN_CTX_get(bnctx); BIGNUM *p = BN_CTX_get(bnctx);
BIGNUM *a = BN_CTX_get(bnctx); BIGNUM *a = BN_CTX_get(bnctx);
BIGNUM *b = BN_CTX_get(bnctx); BIGNUM *b = BN_CTX_get(bnctx);

View File

@ -118,8 +118,9 @@ typedef limb longfelem[NLIMBS * 2];
typedef u64 smallfelem[NLIMBS]; typedef u64 smallfelem[NLIMBS];
/* This is the value of the prime as four 64-bit words, little-endian. */ /* This is the value of the prime as four 64-bit words, little-endian. */
static const u64 kPrime[4] = static const u64 kPrime[4] = {
{ 0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul }; 0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul
};
static const u64 bottom63bits = 0x7ffffffffffffffful; static const u64 bottom63bits = 0x7ffffffffffffffful;
/* /*
@ -292,8 +293,9 @@ static void felem_diff(felem out, const felem in)
#define two107m43p11 (((limb)1) << 107) - (((limb)1) << 43) + (((limb)1) << 11) #define two107m43p11 (((limb)1) << 107) - (((limb)1) << 43) + (((limb)1) << 11)
/* zero107 is 0 mod p */ /* zero107 is 0 mod p */
static const felem zero107 = static const felem zero107 = {
{ two107m43m11, two107, two107m43p11, two107m43p11 }; two107m43m11, two107, two107m43p11, two107m43p11
};
/*- /*-
* An alternative felem_diff for larger inputs |in| * An alternative felem_diff for larger inputs |in|

View File

@ -12,7 +12,7 @@
#include "internal/nelem.h" #include "internal/nelem.h"
#include "crypto/dh.h" #include "crypto/dh.h"
typedef struct dh_name2id_st{ typedef struct dh_name2id_st {
const char *name; const char *name;
int id; int id;
int type; int type;
@ -28,8 +28,7 @@ typedef struct dh_name2id_st{
# define TYPE_DHX 0 # define TYPE_DHX 0
#endif #endif
static const DH_GENTYPE_NAME2ID dhtype2id[] = static const DH_GENTYPE_NAME2ID dhtype2id[] = {
{
{ "group", DH_PARAMGEN_TYPE_GROUP, TYPE_ANY }, { "group", DH_PARAMGEN_TYPE_GROUP, TYPE_ANY },
{ "generator", DH_PARAMGEN_TYPE_GENERATOR, TYPE_DH }, { "generator", DH_PARAMGEN_TYPE_GENERATOR, TYPE_DH },
{ "fips186_4", DH_PARAMGEN_TYPE_FIPS_186_4, TYPE_DHX }, { "fips186_4", DH_PARAMGEN_TYPE_FIPS_186_4, TYPE_DHX },

View File

@ -312,8 +312,9 @@ const EVP_CIPHER *EVP_des_ede3(void)
# include <openssl/sha.h> # include <openssl/sha.h>
static const unsigned char wrap_iv[8] = static const unsigned char wrap_iv[8] = {
{ 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 }; 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05
};
static int des_ede3_unwrap(EVP_CIPHER_CTX *ctx, unsigned char *out, static int des_ede3_unwrap(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t inl) const unsigned char *in, size_t inl)

View File

@ -9,13 +9,12 @@
#define idea_mul(r,a,b,ul) \ #define idea_mul(r,a,b,ul) \
ul=(unsigned long)a*b; \ ul=(unsigned long)a*b; \
if (ul != 0) \ if (ul != 0) { \
{ \
r=(ul&0xffff)-(ul>>16); \ r=(ul&0xffff)-(ul>>16); \
r-=((r)>>16); \ r-=((r)>>16); \
} \ } else { \
else \ r=(-(int)a-b+1); /* assuming a or b is 0 and in range */ \
r=(-(int)a-b+1); /* assuming a or b is 0 and in range */ }
/* NOTE - c is not incremented as per n2l */ /* NOTE - c is not incremented as per n2l */
#define n2ln(c,l1,l2,n) { \ #define n2ln(c,l1,l2,n) { \

View File

@ -88,27 +88,31 @@ int SHA224_Final(unsigned char *md, SHA256_CTX *c)
#define HASH_MAKE_STRING(c,s) do { \ #define HASH_MAKE_STRING(c,s) do { \
unsigned long ll; \ unsigned long ll; \
unsigned int nn; \ unsigned int nn; \
switch ((c)->md_len) \ switch ((c)->md_len) { \
{ case SHA256_192_DIGEST_LENGTH: \ case SHA256_192_DIGEST_LENGTH: \
for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) \ for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) { \
{ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
} \
break; \ break; \
case SHA224_DIGEST_LENGTH: \ case SHA224_DIGEST_LENGTH: \
for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) \ for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) { \
{ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
} \
break; \ break; \
case SHA256_DIGEST_LENGTH: \ case SHA256_DIGEST_LENGTH: \
for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) \ for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) { \
{ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
} \
break; \ break; \
default: \ default: \
if ((c)->md_len > SHA256_DIGEST_LENGTH) \ if ((c)->md_len > SHA256_DIGEST_LENGTH) \
return 0; \ return 0; \
for (nn=0;nn<(c)->md_len/4;nn++) \ for (nn=0;nn<(c)->md_len/4;nn++) { \
{ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
} \
break; \ break; \
} \ } \
} while (0) } while (0)
#define HASH_UPDATE SHA256_Update #define HASH_UPDATE SHA256_Update
#define HASH_TRANSFORM SHA256_Transform #define HASH_TRANSFORM SHA256_Transform

View File

@ -283,8 +283,9 @@ int ossl_sm4_set_key(const uint8_t *key, SM4_KEY *ks)
/* /*
* Family Key * Family Key
*/ */
static const uint32_t FK[4] = static const uint32_t FK[4] = {
{ 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc }; 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc
};
/* /*
* Constant Key * Constant Key

View File

@ -54,8 +54,8 @@ static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method, static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, char *str); X509V3_CTX *ctx, char *str);
const X509V3_EXT_METHOD ossl_v3_pci = const X509V3_EXT_METHOD ossl_v3_pci = {
{ NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION), NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
NULL, NULL, NULL, NULL,

View File

@ -625,8 +625,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
OPENSSL_assert((size_t)BIO_write(in, buf, len) == len); OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
if ((opt & 0x01) != 0) if ((opt & 0x01) != 0) {
{
do { do {
char early_buf[16384]; char early_buf[16384];
size_t early_len; size_t early_len;

View File

@ -396,13 +396,12 @@ static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const uns
#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \ #define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \ static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
{\ {\
while(inl>=EVP_MAXCHUNK) \ while(inl>=EVP_MAXCHUNK) {\
{\
cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\ cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\
inl-=EVP_MAXCHUNK;\ inl-=EVP_MAXCHUNK;\
in +=EVP_MAXCHUNK;\ in +=EVP_MAXCHUNK;\
out+=EVP_MAXCHUNK;\ out+=EVP_MAXCHUNK;\
}\ }\
if (inl)\ if (inl)\
cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\ cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\
return 1;\ return 1;\
@ -414,8 +413,7 @@ static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
size_t chunk = EVP_MAXCHUNK;\ size_t chunk = EVP_MAXCHUNK;\
if (cbits == 1) chunk >>= 3;\ if (cbits == 1) chunk >>= 3;\
if (inl < chunk) chunk = inl;\ if (inl < chunk) chunk = inl;\
while (inl && inl >= chunk)\ while (inl && inl >= chunk) {\
{\
int num = EVP_CIPHER_CTX_get_num(ctx);\ int num = EVP_CIPHER_CTX_get_num(ctx);\
cprefix##_cfb##cbits##_encrypt(in, out, (long) \ cprefix##_cfb##cbits##_encrypt(in, out, (long) \
((cbits == 1) \ ((cbits == 1) \

View File

@ -162,8 +162,7 @@ static int add_params(OSSL_PARAM_BLD *bld, const ST_KAT_PARAM *params,
if (params == NULL) if (params == NULL)
return 1; return 1;
for (p = params; p->data != NULL; ++p) for (p = params; p->data != NULL; ++p) {
{
switch (p->type) { switch (p->type) {
case OSSL_PARAM_UNSIGNED_INTEGER: { case OSSL_PARAM_UNSIGNED_INTEGER: {
BIGNUM *bn = BN_CTX_get(ctx); BIGNUM *bn = BN_CTX_get(ctx);

View File

@ -318,8 +318,7 @@ static int aes_gcm_siv_dup_ctx(void *vdst, void *vsrc)
return 0; return 0;
} }
static const PROV_CIPHER_HW_AES_GCM_SIV aes_gcm_siv_hw = static const PROV_CIPHER_HW_AES_GCM_SIV aes_gcm_siv_hw = {
{
aes_gcm_siv_initkey, aes_gcm_siv_initkey,
aes_gcm_siv_cipher, aes_gcm_siv_cipher,
aes_gcm_siv_dup_ctx, aes_gcm_siv_dup_ctx,

View File

@ -120,8 +120,7 @@ static int aes_siv_cipher(void *vctx, unsigned char *out,
return ossl_siv128_decrypt(sctx, in, out, len) > 0; return ossl_siv128_decrypt(sctx, in, out, len) > 0;
} }
static const PROV_CIPHER_HW_AES_SIV aes_siv_hw = static const PROV_CIPHER_HW_AES_SIV aes_siv_hw = {
{
aes_siv_initkey, aes_siv_initkey,
aes_siv_cipher, aes_siv_cipher,
aes_siv_setspeed, aes_siv_setspeed,

View File

@ -398,8 +398,7 @@ err:
return rv; return rv;
} }
static const PROV_CIPHER_HW_CHACHA20_POLY1305 chacha20poly1305_hw = static const PROV_CIPHER_HW_CHACHA20_POLY1305 chacha20poly1305_hw = {
{
{ chacha20_poly1305_initkey, NULL }, { chacha20_poly1305_initkey, NULL },
chacha20_poly1305_aead_cipher, chacha20_poly1305_aead_cipher,
chacha20_poly1305_initiv, chacha20_poly1305_initiv,

View File

@ -68,8 +68,7 @@ typedef struct cts_mode_name2id_st {
const char *name; const char *name;
} CTS_MODE_NAME2ID; } CTS_MODE_NAME2ID;
static CTS_MODE_NAME2ID cts_modes[] = static CTS_MODE_NAME2ID cts_modes[] = {
{
{ CTS_CS1, OSSL_CIPHER_CTS_MODE_CS1 }, { CTS_CS1, OSSL_CIPHER_CTS_MODE_CS1 },
{ CTS_CS2, OSSL_CIPHER_CTS_MODE_CS2 }, { CTS_CS2, OSSL_CIPHER_CTS_MODE_CS2 },
{ CTS_CS3, OSSL_CIPHER_CTS_MODE_CS3 }, { CTS_CS3, OSSL_CIPHER_CTS_MODE_CS3 },

View File

@ -67,8 +67,7 @@ static int cipher_hw_desx_cbc(PROV_CIPHER_CTX *ctx, unsigned char *out,
return 1; return 1;
} }
static const PROV_CIPHER_HW desx_cbc = static const PROV_CIPHER_HW desx_cbc = {
{
cipher_hw_desx_cbc_initkey, cipher_hw_desx_cbc_initkey,
cipher_hw_desx_cbc, cipher_hw_desx_cbc,
cipher_hw_desx_copyctx cipher_hw_desx_copyctx

View File

@ -27,8 +27,7 @@
static OSSL_FUNC_cipher_update_fn tdes_wrap_update; static OSSL_FUNC_cipher_update_fn tdes_wrap_update;
static OSSL_FUNC_cipher_cipher_fn tdes_wrap_cipher; static OSSL_FUNC_cipher_cipher_fn tdes_wrap_cipher;
static const unsigned char wrap_iv[8] = static const unsigned char wrap_iv[8] = {
{
0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05
}; };

View File

@ -20,14 +20,12 @@
#include "blake2_impl.h" #include "blake2_impl.h"
#include "prov/blake2.h" #include "prov/blake2.h"
static const uint32_t blake2s_IV[8] = static const uint32_t blake2s_IV[8] = {
{
0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU,
0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, 0x5BE0CD19U
}; };
static const uint8_t blake2s_sigma[10][16] = static const uint8_t blake2s_sigma[10][16] = {
{
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,

View File

@ -165,8 +165,7 @@ static int generic_sha3_squeeze(void *vctx, unsigned char *out, size_t outlen)
return ossl_sha3_squeeze((KECCAK1600_CTX *)vctx, out, outlen); return ossl_sha3_squeeze((KECCAK1600_CTX *)vctx, out, outlen);
} }
static PROV_SHA3_METHOD sha3_generic_md = static PROV_SHA3_METHOD sha3_generic_md = {
{
generic_sha3_absorb, generic_sha3_absorb,
generic_sha3_final, generic_sha3_final,
NULL NULL
@ -362,29 +361,25 @@ static int s390x_kmac_squeeze(void *vctx, unsigned char *out, size_t outlen)
return s390x_keccakc_squeeze(vctx, out, outlen, 0x04); return s390x_keccakc_squeeze(vctx, out, outlen, 0x04);
} }
static PROV_SHA3_METHOD sha3_s390x_md = static PROV_SHA3_METHOD sha3_s390x_md = {
{
s390x_sha3_absorb, s390x_sha3_absorb,
s390x_sha3_final, s390x_sha3_final,
NULL, NULL,
}; };
static PROV_SHA3_METHOD keccak_s390x_md = static PROV_SHA3_METHOD keccak_s390x_md = {
{
s390x_sha3_absorb, s390x_sha3_absorb,
s390x_keccak_final, s390x_keccak_final,
s390x_keccak_squeeze, s390x_keccak_squeeze,
}; };
static PROV_SHA3_METHOD shake_s390x_md = static PROV_SHA3_METHOD shake_s390x_md = {
{
s390x_sha3_absorb, s390x_sha3_absorb,
s390x_shake_final, s390x_shake_final,
s390x_shake_squeeze, s390x_shake_squeeze,
}; };
static PROV_SHA3_METHOD kmac_s390x_md = static PROV_SHA3_METHOD kmac_s390x_md = {
{
s390x_sha3_absorb, s390x_sha3_absorb,
s390x_kmac_final, s390x_kmac_final,
s390x_kmac_squeeze, s390x_kmac_squeeze,
@ -429,8 +424,7 @@ static size_t armsha3_sha3_absorb(void *vctx, const void *inp, size_t len)
return SHA3_absorb_cext(ctx->A, inp, len, ctx->block_size); return SHA3_absorb_cext(ctx->A, inp, len, ctx->block_size);
} }
static PROV_SHA3_METHOD sha3_ARMSHA3_md = static PROV_SHA3_METHOD sha3_ARMSHA3_md = {
{
armsha3_sha3_absorb, armsha3_sha3_absorb,
generic_sha3_final generic_sha3_final
}; };

View File

@ -463,8 +463,9 @@ static int kbkdf_get_ctx_params(void *vctx, OSSL_PARAM params[])
static const OSSL_PARAM *kbkdf_gettable_ctx_params(ossl_unused void *ctx, static const OSSL_PARAM *kbkdf_gettable_ctx_params(ossl_unused void *ctx,
ossl_unused void *provctx) ossl_unused void *provctx)
{ {
static const OSSL_PARAM known_gettable_ctx_params[] = static const OSSL_PARAM known_gettable_ctx_params[] = {
{ OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL), OSSL_PARAM_END }; OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL), OSSL_PARAM_END
};
return known_gettable_ctx_params; return known_gettable_ctx_params;
} }

View File

@ -73,8 +73,7 @@ typedef struct dh_name2id_st{
int id; int id;
} DSA_GENTYPE_NAME2ID; } DSA_GENTYPE_NAME2ID;
static const DSA_GENTYPE_NAME2ID dsatype2id[]= static const DSA_GENTYPE_NAME2ID dsatype2id[] = {
{
#ifdef FIPS_MODULE #ifdef FIPS_MODULE
{ "default", DSA_PARAMGEN_TYPE_FIPS_186_4 }, { "default", DSA_PARAMGEN_TYPE_FIPS_186_4 },
#else #else

View File

@ -105,8 +105,7 @@ size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
size_t bytes_needed; size_t bytes_needed;
bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
if (bytes_needed > 0) if (bytes_needed > 0) {
{
int retryCount = 0; int retryCount = 0;
STATUS result = ERROR; STATUS result = ERROR;
unsigned char *buffer; unsigned char *buffer;

View File

@ -1116,8 +1116,7 @@ int SSL_add1_host(SSL *s, const char *hostname)
/* If a hostname is provided and parses as an IP address, /* If a hostname is provided and parses as an IP address,
* treat it as such. */ * treat it as such. */
if (hostname) if (hostname) {
{
ASN1_OCTET_STRING *ip; ASN1_OCTET_STRING *ip;
char *old_ip; char *old_ip;
@ -1127,8 +1126,7 @@ int SSL_add1_host(SSL *s, const char *hostname)
ASN1_OCTET_STRING_free(ip); ASN1_OCTET_STRING_free(ip);
old_ip = X509_VERIFY_PARAM_get1_ip_asc(sc->param); old_ip = X509_VERIFY_PARAM_get1_ip_asc(sc->param);
if (old_ip) if (old_ip) {
{
OPENSSL_free(old_ip); OPENSSL_free(old_ip);
/* There can be only one IP address */ /* There can be only one IP address */
return 0; return 0;
@ -4820,8 +4818,7 @@ int ssl_undefined_const_function(const SSL *s)
const char *ssl_protocol_to_string(int version) const char *ssl_protocol_to_string(int version)
{ {
switch (version) switch (version) {
{
case TLS1_3_VERSION: case TLS1_3_VERSION:
return "TLSv1.3"; return "TLSv1.3";

View File

@ -39,10 +39,12 @@
if (is_complete) for (ii = (((msg_len) - 1) >> 3) - 1; ii >= 0 ; ii--) \ if (is_complete) for (ii = (((msg_len) - 1) >> 3) - 1; ii >= 0 ; ii--) \
if (bitmask[ii] != 0xff) { is_complete = 0; break; } } if (bitmask[ii] != 0xff) { is_complete = 0; break; } }
static const unsigned char bitmask_start_values[] = static const unsigned char bitmask_start_values[] = {
{ 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80 }; 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80
static const unsigned char bitmask_end_values[] = };
{ 0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f }; static const unsigned char bitmask_end_values[] = {
0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f
};
static void dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off, static void dtls1_fix_message_header(SSL_CONNECTION *s, size_t frag_off,
size_t frag_len); size_t frag_len);
@ -1061,8 +1063,7 @@ int dtls1_read_failed(SSL_CONNECTION *s, int code)
return code; return code;
} }
/* done, no need to send a retransmit */ /* done, no need to send a retransmit */
if (!SSL_in_init(ssl)) if (!SSL_in_init(ssl)) {
{
BIO_set_flags(SSL_get_rbio(ssl), BIO_FLAGS_READ); BIO_set_flags(SSL_get_rbio(ssl), BIO_FLAGS_READ);
return code; return code;
} }

View File

@ -163,8 +163,9 @@ static unsigned char cbc_key[16] = {
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87
}; };
static unsigned char cbc_iv[8] = static unsigned char cbc_iv[8] = {
{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
};
static char cbc_data[40] = "7654321 Now is the time for "; static char cbc_data[40] = "7654321 Now is the time for ";
static unsigned char cbc_ok[32] = { static unsigned char cbc_ok[32] = {
0x6B, 0x77, 0xB4, 0xD6, 0x30, 0x06, 0xDE, 0xE6, 0x6B, 0x77, 0xB4, 0xD6, 0x30, 0x06, 0xDE, 0xE6,
@ -195,8 +196,9 @@ static unsigned char key_test[KEY_TEST_NUM] = {
0x88 0x88
}; };
static unsigned char key_data[8] = static unsigned char key_data[8] = {
{ 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10 }; 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10
};
static unsigned char key_out[KEY_TEST_NUM][8] = { static unsigned char key_out[KEY_TEST_NUM][8] = {
{0xF9, 0xAD, 0x59, 0x7C, 0x49, 0xDB, 0x00, 0x5E}, {0xF9, 0xAD, 0x59, 0x7C, 0x49, 0xDB, 0x00, 0x5E},

View File

@ -206,8 +206,7 @@ err:
static int do_test_bio_cipher(const EVP_CIPHER* cipher, int idx) static int do_test_bio_cipher(const EVP_CIPHER* cipher, int idx)
{ {
switch (idx) switch (idx) {
{
case 0: case 0:
return do_bio_cipher(cipher, KEY, NULL); return do_bio_cipher(cipher, KEY, NULL);
case 1: case 1:

View File

@ -29,8 +29,9 @@ static unsigned char k[16] = {
0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A
}; };
static unsigned char in[8] = static unsigned char in[8] = {
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }; 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF
};
static int k_len[3] = { 16, 10, 5 }; static int k_len[3] = { 16, 10, 5 };

View File

@ -177,14 +177,18 @@ static unsigned char cipher_ecb2[NUM_TESTS - 1][8] = {
{0x08, 0xD7, 0xB4, 0xFB, 0x62, 0x9D, 0x08, 0x85} {0x08, 0xD7, 0xB4, 0xFB, 0x62, 0x9D, 0x08, 0x85}
}; };
static unsigned char cbc_key[8] = static unsigned char cbc_key[8] = {
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
static unsigned char cbc2_key[8] = };
{ 0xf1, 0xe0, 0xd3, 0xc2, 0xb5, 0xa4, 0x97, 0x86 }; static unsigned char cbc2_key[8] = {
static unsigned char cbc3_key[8] = 0xf1, 0xe0, 0xd3, 0xc2, 0xb5, 0xa4, 0x97, 0x86
{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; };
static unsigned char cbc_iv[8] = static unsigned char cbc3_key[8] = {
{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
};
static unsigned char cbc_iv[8] = {
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
};
/* /*
* Changed the following text constant to binary so it will work on ebcdic * Changed the following text constant to binary so it will work on ebcdic
* machines :-) * machines :-)
@ -208,8 +212,9 @@ static unsigned char cbc_ok[32] = {
# ifdef SCREW_THE_PARITY # ifdef SCREW_THE_PARITY
# error "SCREW_THE_PARITY is not meant to be defined." # error "SCREW_THE_PARITY is not meant to be defined."
# error "Original vectors are preserved for reference only." # error "Original vectors are preserved for reference only."
static unsigned char cbc2_key[8] = static unsigned char cbc2_key[8] = {
{ 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }; 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87
};
static unsigned char xcbc_ok[32] = { static unsigned char xcbc_ok[32] = {
0x86, 0x74, 0x81, 0x0D, 0x61, 0xA4, 0xA5, 0x48, 0x86, 0x74, 0x81, 0x0D, 0x61, 0xA4, 0xA5, 0x48,
0xB9, 0x93, 0x03, 0xE1, 0xB8, 0xBB, 0xBD, 0xBD, 0xB9, 0x93, 0x03, 0xE1, 0xB8, 0xBB, 0xBD, 0xBD,
@ -239,10 +244,12 @@ static unsigned char pcbc_ok[32] = {
0xf7, 0x17, 0x46, 0x3b, 0x8a, 0xb3, 0xcc, 0x88 0xf7, 0x17, 0x46, 0x3b, 0x8a, 0xb3, 0xcc, 0x88
}; };
static unsigned char cfb_key[8] = static unsigned char cfb_key[8] = {
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
static unsigned char cfb_iv[8] = };
{ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef }; static unsigned char cfb_iv[8] = {
0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
};
static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8]; static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8];
static unsigned char plain[24] = { static unsigned char plain[24] = {
0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73,
@ -276,10 +283,12 @@ static unsigned char cfb_cipher64[24] = {
0x1A, 0x92, 0xF7, 0x84, 0x03, 0x46, 0x71, 0x33, 0x89, 0x8E, 0xA6, 0x22 0x1A, 0x92, 0xF7, 0x84, 0x03, 0x46, 0x71, 0x33, 0x89, 0x8E, 0xA6, 0x22
}; };
static unsigned char ofb_key[8] = static unsigned char ofb_key[8] = {
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
static unsigned char ofb_iv[8] = };
{ 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef }; static unsigned char ofb_iv[8] = {
0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
};
static unsigned char ofb_buf1[24], ofb_buf2[24], ofb_tmp[8]; static unsigned char ofb_buf1[24], ofb_buf2[24], ofb_tmp[8];
static unsigned char ofb_cipher[24] = { static unsigned char ofb_cipher[24] = {
0xf3, 0x09, 0x62, 0x49, 0xc7, 0xf4, 0x6e, 0x51, 0xf3, 0x09, 0x62, 0x49, 0xc7, 0xf4, 0x6e, 0x51,
@ -287,8 +296,9 @@ static unsigned char ofb_cipher[24] = {
0x3d, 0x6d, 0x5b, 0xe3, 0x25, 0x5a, 0xf8, 0xc3 0x3d, 0x6d, 0x5b, 0xe3, 0x25, 0x5a, 0xf8, 0xc3
}; };
static DES_LONG cbc_cksum_ret = 0xF7FE62B4L; static DES_LONG cbc_cksum_ret = 0xF7FE62B4L;
static unsigned char cbc_cksum_data[8] = static unsigned char cbc_cksum_data[8] = {
{ 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4 }; 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4
};
static char *pt(const unsigned char *p, char buf[DATA_BUF_SIZE]) static char *pt(const unsigned char *p, char buf[DATA_BUF_SIZE])
{ {

View File

@ -3504,28 +3504,43 @@ static int test_evp_iv_aes(int idx)
{ {
int ret = 0; int ret = 0;
EVP_CIPHER_CTX *ctx = NULL; EVP_CIPHER_CTX *ctx = NULL;
unsigned char key[16] = {0x4c, 0x43, 0xdb, 0xdd, 0x42, 0x73, 0x47, 0xd1, unsigned char key[16] = {
0xe5, 0x62, 0x7d, 0xcd, 0x4d, 0x76, 0x4d, 0x57}; 0x4c, 0x43, 0xdb, 0xdd, 0x42, 0x73, 0x47, 0xd1,
unsigned char init_iv[EVP_MAX_IV_LENGTH] = 0xe5, 0x62, 0x7d, 0xcd, 0x4d, 0x76, 0x4d, 0x57
{0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98, 0x82, };
0x5a, 0x55, 0x91, 0x81, 0x42, 0xa8, 0x89, 0x34}; unsigned char init_iv[EVP_MAX_IV_LENGTH] = {
static const unsigned char msg[] = { 1, 2, 3, 4, 5, 6, 7, 8, 0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98, 0x82,
9, 10, 11, 12, 13, 14, 15, 16 }; 0x5a, 0x55, 0x91, 0x81, 0x42, 0xa8, 0x89, 0x34
};
static const unsigned char msg[] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16
};
unsigned char ciphertext[32], oiv[16], iv[16]; unsigned char ciphertext[32], oiv[16], iv[16];
unsigned char *ref_iv; unsigned char *ref_iv;
unsigned char cbc_state[16] = {0x10, 0x2f, 0x05, 0xcc, 0xc2, 0x55, 0x72, 0xb9, unsigned char cbc_state[16] = {
0x88, 0xe6, 0x4a, 0x17, 0x10, 0x74, 0x22, 0x5e}; 0x10, 0x2f, 0x05, 0xcc, 0xc2, 0x55, 0x72, 0xb9,
0x88, 0xe6, 0x4a, 0x17, 0x10, 0x74, 0x22, 0x5e
};
unsigned char ofb_state[16] = {0x76, 0xe6, 0x66, 0x61, 0xd0, 0x8a, 0xe4, 0x64, unsigned char ofb_state[16] = {
0xdd, 0x66, 0xbf, 0x00, 0xf0, 0xe3, 0x6f, 0xfd}; 0x76, 0xe6, 0x66, 0x61, 0xd0, 0x8a, 0xe4, 0x64,
unsigned char cfb_state[16] = {0x77, 0xe4, 0x65, 0x65, 0xd5, 0x8c, 0xe3, 0x6c, 0xdd, 0x66, 0xbf, 0x00, 0xf0, 0xe3, 0x6f, 0xfd
0xd4, 0x6c, 0xb4, 0x0c, 0xfd, 0xed, 0x60, 0xed}; };
unsigned char gcm_state[12] = {0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, unsigned char cfb_state[16] = {
0x98, 0x82, 0x5a, 0x55, 0x91, 0x81}; 0x77, 0xe4, 0x65, 0x65, 0xd5, 0x8c, 0xe3, 0x6c,
unsigned char ccm_state[7] = {0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98}; 0xd4, 0x6c, 0xb4, 0x0c, 0xfd, 0xed, 0x60, 0xed
};
unsigned char gcm_state[12] = {
0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b,
0x98, 0x82, 0x5a, 0x55, 0x91, 0x81
};
unsigned char ccm_state[7] = { 0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98 };
#ifndef OPENSSL_NO_OCB #ifndef OPENSSL_NO_OCB
unsigned char ocb_state[12] = {0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, unsigned char ocb_state[12] = {
0x98, 0x82, 0x5a, 0x55, 0x91, 0x81}; 0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b,
0x98, 0x82, 0x5a, 0x55, 0x91, 0x81
};
#endif #endif
int len = sizeof(ciphertext); int len = sizeof(ciphertext);
size_t ivlen, ref_len; size_t ivlen, ref_len;
@ -3654,8 +3669,10 @@ static int test_evp_iv_des(int idx)
static const unsigned char init_iv[8] = { static const unsigned char init_iv[8] = {
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
}; };
static const unsigned char msg[] = { 1, 2, 3, 4, 5, 6, 7, 8, static const unsigned char msg[] = {
9, 10, 11, 12, 13, 14, 15, 16 }; 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16
};
unsigned char ciphertext[32], oiv[8], iv[8]; unsigned char ciphertext[32], oiv[8], iv[8];
unsigned const char *ref_iv; unsigned const char *ref_iv;
static const unsigned char cbc_state_des[8] = { static const unsigned char cbc_state_des[8] = {

View File

@ -531,8 +531,7 @@ static int check_attrs(const STACK_OF(X509_ATTRIBUTE) *bag_attrs, const PKCS12_A
if (!TEST_int_eq(X509_ATTRIBUTE_count(attr), 1)) if (!TEST_int_eq(X509_ATTRIBUTE_count(attr), 1))
goto err; goto err;
for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) {
{
av = X509_ATTRIBUTE_get0_type(attr, j); av = X509_ATTRIBUTE_get0_type(attr, j);
if (!TEST_true(check_asn1_string(av, p_attr->value))) if (!TEST_true(check_asn1_string(av, p_attr->value)))
goto err; goto err;

View File

@ -38,8 +38,9 @@ static const unsigned char cfb_key[16] = {
0xe1, 0xf0, 0xc3, 0xd2, 0xa5, 0xb4, 0x87, 0x96, 0xe1, 0xf0, 0xc3, 0xd2, 0xa5, 0xb4, 0x87, 0x96,
0x69, 0x78, 0x4b, 0x5a, 0x2d, 0x3c, 0x0f, 0x1e, 0x69, 0x78, 0x4b, 0x5a, 0x2d, 0x3c, 0x0f, 0x1e,
}; };
static const unsigned char cfb_iv[80] = static const unsigned char cfb_iv[80] = {
{ 0x34, 0x12, 0x78, 0x56, 0xab, 0x90, 0xef, 0xcd }; 0x34, 0x12, 0x78, 0x56, 0xab, 0x90, 0xef, 0xcd
};
static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8]; static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8];
# define CFB_TEST_SIZE 24 # define CFB_TEST_SIZE 24
static const unsigned char plain[CFB_TEST_SIZE] = { static const unsigned char plain[CFB_TEST_SIZE] = {

View File

@ -40,8 +40,9 @@ static const unsigned char cts128_test_key[16] = "chicken teriyaki";
static const unsigned char cts128_test_input[64] = static const unsigned char cts128_test_input[64] =
"I would like the" " General Gau's C" "I would like the" " General Gau's C"
"hicken, please, " "and wonton soup."; "hicken, please, " "and wonton soup.";
static const unsigned char cts128_test_iv[] = static const unsigned char cts128_test_iv[] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
static const unsigned char vector_17[17] = { static const unsigned char vector_17[17] = {
0xc6, 0x35, 0x35, 0x68, 0xf2, 0xbf, 0x8c, 0xb4, 0xc6, 0x35, 0x35, 0x68, 0xf2, 0xbf, 0x8c, 0xb4,

View File

@ -30,8 +30,7 @@ static OSSL_PROVIDER *lgcyprov = NULL;
* PKCS12 component test data * PKCS12 component test data
*/ */
static const unsigned char CERT1[] = static const unsigned char CERT1[] = {
{
0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00,
0x8b, 0x4b, 0x5e, 0x6c, 0x03, 0x28, 0x4e, 0xe6, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0x8b, 0x4b, 0x5e, 0x6c, 0x03, 0x28, 0x4e, 0xe6, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55,
@ -66,8 +65,7 @@ static const unsigned char CERT1[] =
0x30, 0x30,
}; };
static const unsigned char CERT2[] = static const unsigned char CERT2[] = {
{
0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x30, 0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x56, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00,
0x8b, 0x4b, 0x5e, 0x6c, 0x03, 0x28, 0x4e, 0xe7, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0x8b, 0x4b, 0x5e, 0x6c, 0x03, 0x28, 0x4e, 0xe7, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55,
@ -102,8 +100,7 @@ static const unsigned char CERT2[] =
0x0b, 0x0b,
}; };
static const unsigned char KEY1[] = static const unsigned char KEY1[] = {
{
0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xbc, 0xdc, 0x6f, 0x8c, 0x7a, 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xbc, 0xdc, 0x6f, 0x8c, 0x7a,
0x2a, 0x4b, 0xea, 0x66, 0x66, 0x04, 0xa9, 0x05, 0x92, 0x53, 0xd7, 0x13, 0x3c, 0x49, 0xe1, 0xc8, 0x2a, 0x4b, 0xea, 0x66, 0x66, 0x04, 0xa9, 0x05, 0x92, 0x53, 0xd7, 0x13, 0x3c, 0x49, 0xe1, 0xc8,
0xbb, 0xdf, 0x3d, 0xcb, 0x88, 0x31, 0x07, 0x20, 0x59, 0x93, 0x24, 0x7f, 0x7d, 0xc6, 0x84, 0x81, 0xbb, 0xdf, 0x3d, 0xcb, 0x88, 0x31, 0x07, 0x20, 0x59, 0x93, 0x24, 0x7f, 0x7d, 0xc6, 0x84, 0x81,
@ -146,8 +143,7 @@ static const unsigned char KEY1[] =
}; };
static const unsigned char KEY2[] = static const unsigned char KEY2[] = {
{
0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xa8, 0x6e, 0x40, 0x86, 0x9f, 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xa8, 0x6e, 0x40, 0x86, 0x9f,
0x98, 0x59, 0xfb, 0x57, 0xbf, 0xc1, 0x55, 0x12, 0x38, 0xeb, 0xb3, 0x46, 0x34, 0xc9, 0x35, 0x4d, 0x98, 0x59, 0xfb, 0x57, 0xbf, 0xc1, 0x55, 0x12, 0x38, 0xeb, 0xb3, 0x46, 0x34, 0xc9, 0x35, 0x4d,
0xfd, 0x03, 0xe9, 0x3a, 0x88, 0x9e, 0x97, 0x8f, 0xf4, 0xec, 0x36, 0x7b, 0x3f, 0xba, 0xb8, 0xa5, 0xfd, 0x03, 0xe9, 0x3a, 0x88, 0x9e, 0x97, 0x8f, 0xf4, 0xec, 0x36, 0x7b, 0x3f, 0xba, 0xb8, 0xa5,

View File

@ -480,8 +480,7 @@ end:
return ret; return ret;
} }
static int keygen_size[] = static int keygen_size[] = {
{
2048, 3072 2048, 3072
}; };

View File

@ -903,8 +903,7 @@ int main(int argc, char *argv[])
int ret = EXIT_FAILURE; int ret = EXIT_FAILURE;
int client_auth = 0; int client_auth = 0;
int server_auth = 0, i; int server_auth = 0, i;
struct app_verify_arg app_verify_arg = struct app_verify_arg app_verify_arg = { APP_CALLBACK_STRING, 0 };
{ APP_CALLBACK_STRING, 0 };
SSL_CTX *c_ctx = NULL; SSL_CTX *c_ctx = NULL;
const SSL_METHOD *meth = NULL; const SSL_METHOD *meth = NULL;
SSL *c_ssl = NULL; SSL *c_ssl = NULL;

View File

@ -140,8 +140,7 @@ static int test_func(int test)
* bytes from the record header/padding etc. * bytes from the record header/padding etc.
*/ */
for (ret = -1, i = 0, len = 0; len != sizeof(testdata) && for (ret = -1, i = 0, len = 0; len != sizeof(testdata) &&
i < MAX_ATTEMPTS; i++) i < MAX_ATTEMPTS; i++) {
{
if (test >= 5 && (!TEST_true(SSL_free_buffers(serverssl)) if (test >= 5 && (!TEST_true(SSL_free_buffers(serverssl))
|| !TEST_true(checkbuffers(serverssl, 0)))) || !TEST_true(checkbuffers(serverssl, 0))))
goto end; goto end;