Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ WOLFSSL_NO_DH186
WOLFSSL_NO_DTLS_SIZE_CHECK
WOLFSSL_NO_ETM_ALERT
WOLFSSL_NO_FENCE
WOLFSSL_NO_FSEEK
WOLFSSL_NO_INIT_CTX_KEY
WOLFSSL_NO_ISSUERHASH_TDPEER
WOLFSSL_NO_KCAPI_AES_CBC
Expand Down
11 changes: 0 additions & 11 deletions src/ssl_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY)
#ifndef NO_BIO

#ifdef WOLFSSL_NO_FSEEK
/* Amount of memory to allocate/add. */
#define READ_BIO_FILE_CHUNK 128

Expand Down Expand Up @@ -109,7 +108,6 @@ static int wolfssl_read_bio_file(WOLFSSL_BIO* bio, char** data)
*data = mem;
return ret;
}
#endif

/* Read exactly the required amount into a newly allocated buffer.
*
Expand Down Expand Up @@ -171,15 +169,7 @@ static int wolfssl_read_bio(WOLFSSL_BIO* bio, char** data, int* dataSz,
}
*memAlloced = 0;
}
#ifndef WOLFSSL_NO_FSEEK
/* Get pending or, when a file BIO, get length of file. */
else if ((sz = wolfSSL_BIO_get_len(bio)) > 0) {
ret = wolfssl_read_bio_len(bio, sz, data);
if (ret > 0) {
*memAlloced = 1;
}
}
#else
else if ((sz = wolfSSL_BIO_pending(bio)) > 0) {
ret = wolfssl_read_bio_len(bio, sz, data);
if (ret > 0) {
Expand All @@ -192,7 +182,6 @@ static int wolfssl_read_bio(WOLFSSL_BIO* bio, char** data, int* dataSz,
*memAlloced = 1;
}
}
#endif
else {
WOLFSSL_ERROR_MSG("No data read from bio");
*memAlloced = 0;
Expand Down
5 changes: 5 additions & 0 deletions wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -8231,11 +8231,16 @@ int wc_CreatePKCS8Key(byte* out, word32* outSz, byte* key, word32 keySz,
ret = BAD_FUNC_ARG;
}

#ifndef WOLFSSL_NO_ASN_STRICT
/* Sanity check: make sure key doesn't have PKCS #8 header. */
if (ToTraditionalInline_ex(key, &keyIdx, keySz, &tmpAlgId) >= 0) {
(void)tmpAlgId;
ret = ASN_PARSE_E;
}
#else
(void)keyIdx;
(void)tmpAlgId;
#endif

CALLOC_ASNSETDATA(dataASN, pkcs8KeyASN_Length-1, ret, NULL);

Expand Down