Skip to content

Commit bfeb0ad

Browse files
committed
expand opensslcoexist to all low level crypto APIs.
1 parent 033a2a0 commit bfeb0ad

42 files changed

Lines changed: 1881 additions & 1716 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

linuxkm/lkcapi_glue.c

Lines changed: 79 additions & 79 deletions
Large diffs are not rendered by default.

src/internal.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -796,16 +796,16 @@ static int ExportCipherSpecState(WOLFSSL* ssl, byte* exp, word32 len, byte ver,
796796
ssl->specs.bulk_cipher_algorithm == wolfssl_aes) {
797797
byte *pt = (byte*)ssl->encrypt.aes->reg;
798798

799-
if ((idx + 2*AES_BLOCK_SIZE) > len) {
799+
if ((idx + 2*WC_AES_BLOCK_SIZE) > len) {
800800
WOLFSSL_MSG("Can not fit AES state into buffer");
801801
return BUFFER_E;
802802
}
803-
XMEMCPY(exp + idx, pt, AES_BLOCK_SIZE);
804-
idx += AES_BLOCK_SIZE;
803+
XMEMCPY(exp + idx, pt, WC_AES_BLOCK_SIZE);
804+
idx += WC_AES_BLOCK_SIZE;
805805

806806
pt = (byte*)ssl->decrypt.aes->reg;
807-
XMEMCPY(exp + idx, pt, AES_BLOCK_SIZE);
808-
idx += AES_BLOCK_SIZE;
807+
XMEMCPY(exp + idx, pt, WC_AES_BLOCK_SIZE);
808+
idx += WC_AES_BLOCK_SIZE;
809809
}
810810

811811
WOLFSSL_LEAVE("ExportCipherSpecState", idx);
@@ -1048,12 +1048,12 @@ static int ImportCipherSpecState(WOLFSSL* ssl, const byte* exp, word32 len,
10481048
if (type == WOLFSSL_EXPORT_TLS &&
10491049
ssl->specs.bulk_cipher_algorithm == wolfssl_aes) {
10501050
byte *pt = (byte*)ssl->encrypt.aes->reg;
1051-
XMEMCPY(pt, exp + idx, AES_BLOCK_SIZE);
1052-
idx += AES_BLOCK_SIZE;
1051+
XMEMCPY(pt, exp + idx, WC_AES_BLOCK_SIZE);
1052+
idx += WC_AES_BLOCK_SIZE;
10531053

10541054
pt = (byte*)ssl->decrypt.aes->reg;
1055-
XMEMCPY(pt, exp + idx, AES_BLOCK_SIZE);
1056-
idx += AES_BLOCK_SIZE;
1055+
XMEMCPY(pt, exp + idx, WC_AES_BLOCK_SIZE);
1056+
idx += WC_AES_BLOCK_SIZE;
10571057
}
10581058

10591059
WOLFSSL_LEAVE("ImportCipherSpecState", idx);
@@ -2108,7 +2108,7 @@ int wolfSSL_session_export_internal(WOLFSSL* ssl, byte* buf, word32* sz,
21082108

21092109
/* possible AES state needed */
21102110
if (type == WOLFSSL_EXPORT_TLS) {
2111-
*sz += AES_BLOCK_SIZE*2;
2111+
*sz += WC_AES_BLOCK_SIZE*2;
21122112
}
21132113
ret = WC_NO_ERR_TRACE(LENGTH_ONLY_E);
21142114
}
@@ -39554,7 +39554,7 @@ static int TicketEncDec(byte* key, int keyLen, byte* iv, byte* aad, int aadSz,
3955439554
}
3955539555
if (ret == 0) {
3955639556
ret = wc_AesGcmEncrypt(aes, in, out, inLen, iv, GCM_NONCE_MID_SZ,
39557-
tag, AES_BLOCK_SIZE, aad, aadSz);
39557+
tag, WC_AES_BLOCK_SIZE, aad, aadSz);
3955839558
}
3955939559
wc_AesFree(aes);
3956039560
}
@@ -39565,7 +39565,7 @@ static int TicketEncDec(byte* key, int keyLen, byte* iv, byte* aad, int aadSz,
3956539565
}
3956639566
if (ret == 0) {
3956739567
ret = wc_AesGcmDecrypt(aes, in, out, inLen, iv, GCM_NONCE_MID_SZ,
39568-
tag, AES_BLOCK_SIZE, aad, aadSz);
39568+
tag, WC_AES_BLOCK_SIZE, aad, aadSz);
3956939569
}
3957039570
wc_AesFree(aes);
3957139571
}

src/keys.c

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

src/pk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12980,7 +12980,7 @@ int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* ec,
1298012980
/* Calculate maximum size of DER encoding.
1298112981
* 4 > size of pub, priv + ASN.1 additional information */
1298212982
der_max_len = 4 * (word32)wc_ecc_size((ecc_key*)ec->internal) +
12983-
AES_BLOCK_SIZE;
12983+
WC_AES_BLOCK_SIZE;
1298412984

1298512985
/* Allocate buffer big enough to hold encoding. */
1298612986
derBuf = (byte*)XMALLOC((size_t)der_max_len, NULL,

src/ssl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24982,7 +24982,7 @@ int wolfSSL_RAND_load_file(const char* fname, long len)
2498224982
case WC_AES_192_CTR_TYPE :
2498324983
case WC_AES_256_CTR_TYPE :
2498424984
WOLFSSL_MSG("AES CTR");
24985-
XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE);
24985+
XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, WC_AES_BLOCK_SIZE);
2498624986
break;
2498724987
#endif /* WOLFSSL_AES_COUNTER */
2498824988
#ifdef WOLFSSL_AES_CFB
@@ -25121,15 +25121,15 @@ int wolfSSL_RAND_load_file(const char* fname, long len)
2512125121
case WC_AES_192_CBC_TYPE :
2512225122
case WC_AES_256_CBC_TYPE :
2512325123
WOLFSSL_MSG("AES CBC");
25124-
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, AES_BLOCK_SIZE);
25124+
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, WC_AES_BLOCK_SIZE);
2512525125
break;
2512625126
#endif
2512725127
#ifdef HAVE_AESGCM
2512825128
case WC_AES_128_GCM_TYPE :
2512925129
case WC_AES_192_GCM_TYPE :
2513025130
case WC_AES_256_GCM_TYPE :
2513125131
WOLFSSL_MSG("AES GCM");
25132-
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, AES_BLOCK_SIZE);
25132+
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, WC_AES_BLOCK_SIZE);
2513325133
break;
2513425134
#endif
2513525135
#ifdef HAVE_AES_ECB
@@ -25144,7 +25144,7 @@ int wolfSSL_RAND_load_file(const char* fname, long len)
2514425144
case WC_AES_192_CTR_TYPE :
2514525145
case WC_AES_256_CTR_TYPE :
2514625146
WOLFSSL_MSG("AES CTR");
25147-
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, AES_BLOCK_SIZE);
25147+
XMEMCPY(&ctx->cipher.aes.reg, ctx->iv, WC_AES_BLOCK_SIZE);
2514825148
break;
2514925149
#endif
2515025150

@@ -25274,7 +25274,7 @@ void wolfSSL_aes_ctr_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
2527425274
if (doset)
2527525275
(void)wc_AesSetIV(&ctx->cipher.aes, iv); /* OpenSSL compat, no ret */
2527625276
else
25277-
XMEMCPY(iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE);
25277+
XMEMCPY(iv, &ctx->cipher.aes.reg, WC_AES_BLOCK_SIZE);
2527825278
}
2527925279

2528025280
#endif /* NO_AES */

0 commit comments

Comments
 (0)