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)
cp = out_buf + strlen(out_buf);
*cp++ = ascii_dollar[0];
-# define b64_from_24bit(B2, B1, B0, N) \
+# define b64_from_24bit(B2, B1, B0, N) \
do { \
unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \
int i = (N); \
- while (i-- > 0) \
- { \
+ while (i-- > 0) { \
*cp++ = cov_2char[w & 0x3f]; \
w >>= 6; \
} \
}
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);
print_attribute(out, av);
}
static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
const openssl_speed_sec_t *seconds)
{
- static const int mblengths_list[] =
- { 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024 };
+ static const int mblengths_list[] = {
+ 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024
+ };
const int *mblengths = mblengths_list;
int j, count, keylen, num = OSSL_NELEM(mblengths_list), ciph_success = 1;
const char *alg_name;
again = (buf[i - 1] == '\\');
for (j = 0; j < i; j++) {
- if (!ossl_isxdigit(buf[j]))
- {
+ if (!ossl_isxdigit(buf[j])) {
i = j;
break;
}
/* Windows doesn't seem to have in_addr_t */
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
static uint32_t he_fallback_address;
- static const char *he_fallback_addresses[] =
- { (char *)&he_fallback_address, NULL };
+ static const char *he_fallback_addresses[] = {
+ (char *)&he_fallback_address, NULL
+ };
#else
static in_addr_t he_fallback_address;
- static const char *he_fallback_addresses[] =
- { (char *)&he_fallback_address, NULL };
+ static const char *he_fallback_addresses[] = {
+ (char *)&he_fallback_address, NULL
+ };
#endif
- static const struct hostent he_fallback =
- { NULL, NULL, AF_INET, sizeof(he_fallback_address),
- (char **)&he_fallback_addresses };
+ static const struct hostent he_fallback = {
+ NULL, NULL, AF_INET, sizeof(he_fallback_address),
+ (char **)&he_fallback_addresses
+ };
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
# pragma pointer_size restore
#endif
const BIGNUM *BN_value_one(void)
{
static const BN_ULONG data_one = 1L;
- static const BIGNUM const_one =
- { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA };
+ static const BIGNUM const_one = {
+ (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
+ };
return &const_one;
}
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL
};
-static const BN_ULONG _nist_p_521[] =
- { 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
+static const BN_ULONG _nist_p_521[] = {
+ 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
{
- static const int shifts2[16] =
- { 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0 };
+ static const int shifts2[16] = {
+ 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 const unsigned char *in;
register DES_LONG *k;
}
/** identity = (0,1) */
-const curve448_point_t ossl_curve448_point_identity =
- { {{{{0}}}, {{{1}}}, {{{1}}}, {{{0}}}} };
+const curve448_point_t ossl_curve448_point_identity = {
+ {{{{0}}}, {{{1}}}, {{{1}}}, {{{0}}}}
+};
static void point_double_internal(curve448_point_t p, const curve448_point_t q,
int before_double)
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_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 *a = BN_CTX_get(bnctx);
BIGNUM *b = BN_CTX_get(bnctx);
typedef u64 smallfelem[NLIMBS];
/* This is the value of the prime as four 64-bit words, little-endian. */
-static const u64 kPrime[4] =
- { 0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul };
+static const u64 kPrime[4] = {
+ 0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul
+};
static const u64 bottom63bits = 0x7ffffffffffffffful;
/*
#define two107m43p11 (((limb)1) << 107) - (((limb)1) << 43) + (((limb)1) << 11)
/* zero107 is 0 mod p */
-static const felem zero107 =
- { two107m43m11, two107, two107m43p11, two107m43p11 };
+static const felem zero107 = {
+ two107m43m11, two107, two107m43p11, two107m43p11
+};
/*-
* An alternative felem_diff for larger inputs |in|
#include "internal/nelem.h"
#include "crypto/dh.h"
-typedef struct dh_name2id_st{
+typedef struct dh_name2id_st {
const char *name;
int id;
int type;
# define TYPE_DHX 0
#endif
-static const DH_GENTYPE_NAME2ID dhtype2id[] =
-{
+static const DH_GENTYPE_NAME2ID dhtype2id[] = {
{ "group", DH_PARAMGEN_TYPE_GROUP, TYPE_ANY },
{ "generator", DH_PARAMGEN_TYPE_GENERATOR, TYPE_DH },
{ "fips186_4", DH_PARAMGEN_TYPE_FIPS_186_4, TYPE_DHX },
# include <openssl/sha.h>
-static const unsigned char wrap_iv[8] =
- { 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 };
+static const unsigned char wrap_iv[8] = {
+ 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05
+};
static int des_ede3_unwrap(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t inl)
#define idea_mul(r,a,b,ul) \
ul=(unsigned long)a*b; \
-if (ul != 0) \
- { \
+if (ul != 0) { \
r=(ul&0xffff)-(ul>>16); \
r-=((r)>>16); \
- } \
-else \
- r=(-(int)a-b+1); /* assuming a or b is 0 and in range */
+} else { \
+ r=(-(int)a-b+1); /* assuming a or b is 0 and in range */ \
+}
/* NOTE - c is not incremented as per n2l */
#define n2ln(c,l1,l2,n) { \
#define HASH_MAKE_STRING(c,s) do { \
unsigned long ll; \
unsigned int nn; \
- switch ((c)->md_len) \
- { case SHA256_192_DIGEST_LENGTH: \
- for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) \
- { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \
+ switch ((c)->md_len) { \
+ case SHA256_192_DIGEST_LENGTH: \
+ for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) { \
+ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
+ } \
break; \
case SHA224_DIGEST_LENGTH: \
- for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) \
- { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \
+ for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) { \
+ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
+ } \
break; \
case SHA256_DIGEST_LENGTH: \
- for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) \
- { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \
+ for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) { \
+ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
+ } \
break; \
default: \
if ((c)->md_len > SHA256_DIGEST_LENGTH) \
return 0; \
- for (nn=0;nn<(c)->md_len/4;nn++) \
- { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \
+ for (nn=0;nn<(c)->md_len/4;nn++) { \
+ ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); \
+ } \
break; \
} \
- } while (0)
+ } while (0)
#define HASH_UPDATE SHA256_Update
#define HASH_TRANSFORM SHA256_Transform
/*
* Family Key
*/
- static const uint32_t FK[4] =
- { 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc };
+ static const uint32_t FK[4] = {
+ 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc
+ };
/*
* Constant Key
static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, char *str);
-const X509V3_EXT_METHOD ossl_v3_pci =
- { NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
+const X509V3_EXT_METHOD ossl_v3_pci = {
+ NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),
0, 0, 0, 0,
0, 0,
NULL, NULL,
OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
- if ((opt & 0x01) != 0)
- {
+ if ((opt & 0x01) != 0) {
do {
char early_buf[16384];
size_t early_len;
#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) \
{\
- 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));\
inl-=EVP_MAXCHUNK;\
in +=EVP_MAXCHUNK;\
out+=EVP_MAXCHUNK;\
- }\
+ }\
if (inl)\
cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\
return 1;\
size_t chunk = EVP_MAXCHUNK;\
if (cbits == 1) chunk >>= 3;\
if (inl < chunk) chunk = inl;\
- while (inl && inl >= chunk)\
- {\
+ while (inl && inl >= chunk) {\
int num = EVP_CIPHER_CTX_get_num(ctx);\
cprefix##_cfb##cbits##_encrypt(in, out, (long) \
((cbits == 1) \
if (params == NULL)
return 1;
- for (p = params; p->data != NULL; ++p)
- {
+ for (p = params; p->data != NULL; ++p) {
switch (p->type) {
case OSSL_PARAM_UNSIGNED_INTEGER: {
BIGNUM *bn = BN_CTX_get(ctx);
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_cipher,
aes_gcm_siv_dup_ctx,
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_cipher,
aes_siv_setspeed,
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_aead_cipher,
chacha20_poly1305_initiv,
const char *name;
} CTS_MODE_NAME2ID;
-static CTS_MODE_NAME2ID cts_modes[] =
-{
+static CTS_MODE_NAME2ID cts_modes[] = {
{ CTS_CS1, OSSL_CIPHER_CTS_MODE_CS1 },
{ CTS_CS2, OSSL_CIPHER_CTS_MODE_CS2 },
{ CTS_CS3, OSSL_CIPHER_CTS_MODE_CS3 },
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,
cipher_hw_desx_copyctx
static OSSL_FUNC_cipher_update_fn tdes_wrap_update;
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
};
#include "blake2_impl.h"
#include "prov/blake2.h"
-static const uint32_t blake2s_IV[8] =
-{
+static const uint32_t blake2s_IV[8] = {
0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU,
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 } ,
{ 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 } ,
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_final,
NULL
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_final,
NULL,
};
-static PROV_SHA3_METHOD keccak_s390x_md =
-{
+static PROV_SHA3_METHOD keccak_s390x_md = {
s390x_sha3_absorb,
s390x_keccak_final,
s390x_keccak_squeeze,
};
-static PROV_SHA3_METHOD shake_s390x_md =
-{
+static PROV_SHA3_METHOD shake_s390x_md = {
s390x_sha3_absorb,
s390x_shake_final,
s390x_shake_squeeze,
};
-static PROV_SHA3_METHOD kmac_s390x_md =
-{
+static PROV_SHA3_METHOD kmac_s390x_md = {
s390x_sha3_absorb,
s390x_kmac_final,
s390x_kmac_squeeze,
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,
generic_sha3_final
};
static const OSSL_PARAM *kbkdf_gettable_ctx_params(ossl_unused void *ctx,
ossl_unused void *provctx)
{
- static const OSSL_PARAM known_gettable_ctx_params[] =
- { OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL), OSSL_PARAM_END };
+ static const OSSL_PARAM known_gettable_ctx_params[] = {
+ OSSL_PARAM_size_t(OSSL_KDF_PARAM_SIZE, NULL), OSSL_PARAM_END
+ };
return known_gettable_ctx_params;
}
int id;
} DSA_GENTYPE_NAME2ID;
-static const DSA_GENTYPE_NAME2ID dsatype2id[]=
-{
+static const DSA_GENTYPE_NAME2ID dsatype2id[] = {
#ifdef FIPS_MODULE
{ "default", DSA_PARAMGEN_TYPE_FIPS_186_4 },
#else
size_t bytes_needed;
bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
- if (bytes_needed > 0)
- {
+ if (bytes_needed > 0) {
int retryCount = 0;
STATUS result = ERROR;
unsigned char *buffer;
/* If a hostname is provided and parses as an IP address,
* treat it as such. */
- if (hostname)
- {
+ if (hostname) {
ASN1_OCTET_STRING *ip;
char *old_ip;
ASN1_OCTET_STRING_free(ip);
old_ip = X509_VERIFY_PARAM_get1_ip_asc(sc->param);
- if (old_ip)
- {
+ if (old_ip) {
OPENSSL_free(old_ip);
/* There can be only one IP address */
return 0;
const char *ssl_protocol_to_string(int version)
{
- switch (version)
- {
+ switch (version) {
case TLS1_3_VERSION:
return "TLSv1.3";
if (is_complete) for (ii = (((msg_len) - 1) >> 3) - 1; ii >= 0 ; ii--) \
if (bitmask[ii] != 0xff) { is_complete = 0; break; } }
-static const unsigned char bitmask_start_values[] =
- { 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_start_values[] = {
+ 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80
+};
+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,
size_t frag_len);
return code;
}
/* 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);
return code;
}
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87
};
-static unsigned char cbc_iv[8] =
- { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
+static unsigned char cbc_iv[8] = {
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+};
static char cbc_data[40] = "7654321 Now is the time for ";
static unsigned char cbc_ok[32] = {
0x6B, 0x77, 0xB4, 0xD6, 0x30, 0x06, 0xDE, 0xE6,
0x88
};
-static unsigned char key_data[8] =
- { 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10 };
+static unsigned char key_data[8] = {
+ 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10
+};
static unsigned char key_out[KEY_TEST_NUM][8] = {
{0xF9, 0xAD, 0x59, 0x7C, 0x49, 0xDB, 0x00, 0x5E},
static int do_test_bio_cipher(const EVP_CIPHER* cipher, int idx)
{
- switch (idx)
- {
+ switch (idx) {
case 0:
return do_bio_cipher(cipher, KEY, NULL);
case 1:
0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A
};
-static unsigned char in[8] =
- { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF };
+static unsigned char in[8] = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF
+};
static int k_len[3] = { 16, 10, 5 };
{0x08, 0xD7, 0xB4, 0xFB, 0x62, 0x9D, 0x08, 0x85}
};
-static unsigned char cbc_key[8] =
- { 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 cbc3_key[8] =
- { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
-static unsigned char cbc_iv[8] =
- { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
+static unsigned char cbc_key[8] = {
+ 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 cbc3_key[8] = {
+ 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
* machines :-)
# ifdef SCREW_THE_PARITY
# error "SCREW_THE_PARITY is not meant to be defined."
# error "Original vectors are preserved for reference only."
-static unsigned char cbc2_key[8] =
- { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 };
+static unsigned char cbc2_key[8] = {
+ 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87
+};
static unsigned char xcbc_ok[32] = {
0x86, 0x74, 0x81, 0x0D, 0x61, 0xA4, 0xA5, 0x48,
0xB9, 0x93, 0x03, 0xE1, 0xB8, 0xBB, 0xBD, 0xBD,
0xf7, 0x17, 0x46, 0x3b, 0x8a, 0xb3, 0xcc, 0x88
};
-static unsigned char cfb_key[8] =
- { 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_key[8] = {
+ 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_buf1[40], cfb_buf2[40], cfb_tmp[8];
static unsigned char plain[24] = {
0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73,
0x1A, 0x92, 0xF7, 0x84, 0x03, 0x46, 0x71, 0x33, 0x89, 0x8E, 0xA6, 0x22
};
-static unsigned char ofb_key[8] =
- { 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_key[8] = {
+ 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_buf1[24], ofb_buf2[24], ofb_tmp[8];
static unsigned char ofb_cipher[24] = {
0xf3, 0x09, 0x62, 0x49, 0xc7, 0xf4, 0x6e, 0x51,
0x3d, 0x6d, 0x5b, 0xe3, 0x25, 0x5a, 0xf8, 0xc3
};
static DES_LONG cbc_cksum_ret = 0xF7FE62B4L;
-static unsigned char cbc_cksum_data[8] =
- { 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4 };
+static unsigned char cbc_cksum_data[8] = {
+ 0x1D, 0x26, 0x93, 0x97, 0xf7, 0xfe, 0x62, 0xb4
+};
static char *pt(const unsigned char *p, char buf[DATA_BUF_SIZE])
{
{
int ret = 0;
EVP_CIPHER_CTX *ctx = NULL;
- unsigned char key[16] = {0x4c, 0x43, 0xdb, 0xdd, 0x42, 0x73, 0x47, 0xd1,
- 0xe5, 0x62, 0x7d, 0xcd, 0x4d, 0x76, 0x4d, 0x57};
- unsigned char init_iv[EVP_MAX_IV_LENGTH] =
- {0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98, 0x82,
- 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 key[16] = {
+ 0x4c, 0x43, 0xdb, 0xdd, 0x42, 0x73, 0x47, 0xd1,
+ 0xe5, 0x62, 0x7d, 0xcd, 0x4d, 0x76, 0x4d, 0x57
+ };
+ unsigned char init_iv[EVP_MAX_IV_LENGTH] = {
+ 0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b, 0x98, 0x82,
+ 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 *ref_iv;
- unsigned char cbc_state[16] = {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,
- 0xdd, 0x66, 0xbf, 0x00, 0xf0, 0xe3, 0x6f, 0xfd};
- unsigned char cfb_state[16] = {0x77, 0xe4, 0x65, 0x65, 0xd5, 0x8c, 0xe3, 0x6c,
- 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};
+ unsigned char cbc_state[16] = {
+ 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,
+ 0xdd, 0x66, 0xbf, 0x00, 0xf0, 0xe3, 0x6f, 0xfd
+ };
+ unsigned char cfb_state[16] = {
+ 0x77, 0xe4, 0x65, 0x65, 0xd5, 0x8c, 0xe3, 0x6c,
+ 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
- unsigned char ocb_state[12] = {0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b,
- 0x98, 0x82, 0x5a, 0x55, 0x91, 0x81};
+ unsigned char ocb_state[12] = {
+ 0x57, 0x71, 0x7d, 0xad, 0xdb, 0x9b,
+ 0x98, 0x82, 0x5a, 0x55, 0x91, 0x81
+ };
#endif
int len = sizeof(ciphertext);
size_t ivlen, ref_len;
static const unsigned char init_iv[8] = {
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
};
- static const unsigned char msg[] = { 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16 };
+ 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[8], iv[8];
unsigned const char *ref_iv;
static const unsigned char cbc_state_des[8] = {
if (!TEST_int_eq(X509_ATTRIBUTE_count(attr), 1))
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);
if (!TEST_true(check_asn1_string(av, p_attr->value)))
goto err;
0xe1, 0xf0, 0xc3, 0xd2, 0xa5, 0xb4, 0x87, 0x96,
0x69, 0x78, 0x4b, 0x5a, 0x2d, 0x3c, 0x0f, 0x1e,
};
-static const unsigned char cfb_iv[80] =
- { 0x34, 0x12, 0x78, 0x56, 0xab, 0x90, 0xef, 0xcd };
+static const unsigned char cfb_iv[80] = {
+ 0x34, 0x12, 0x78, 0x56, 0xab, 0x90, 0xef, 0xcd
+};
static unsigned char cfb_buf1[40], cfb_buf2[40], cfb_tmp[8];
# define CFB_TEST_SIZE 24
static const unsigned char plain[CFB_TEST_SIZE] = {
static const unsigned char cts128_test_input[64] =
"I would like the" " General Gau's C"
"hicken, please, " "and wonton soup.";
-static const unsigned char cts128_test_iv[] =
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static const unsigned char cts128_test_iv[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
static const unsigned char vector_17[17] = {
0xc6, 0x35, 0x35, 0x68, 0xf2, 0xbf, 0x8c, 0xb4,
* 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,
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,
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,
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,
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,
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,
};
-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,
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,
return ret;
}
-static int keygen_size[] =
-{
+static int keygen_size[] = {
2048, 3072
};
int ret = EXIT_FAILURE;
int client_auth = 0;
int server_auth = 0, i;
- struct app_verify_arg app_verify_arg =
- { APP_CALLBACK_STRING, 0 };
+ struct app_verify_arg app_verify_arg = { APP_CALLBACK_STRING, 0 };
SSL_CTX *c_ctx = NULL;
const SSL_METHOD *meth = NULL;
SSL *c_ssl = NULL;
* bytes from the record header/padding etc.
*/
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))
|| !TEST_true(checkbuffers(serverssl, 0))))
goto end;