mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
SSL: Loading bad private key
Fix ProcessBufferTryDecodeRsa and ProcessBufferTryDecodeEcc to only clear error when key format isn't known.
This commit is contained in:
10
src/ssl.c
10
src/ssl.c
@ -6543,7 +6543,10 @@ static int ProcessBufferTryDecodeRsa(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
|
|||||||
"not enabled to try");
|
"not enabled to try");
|
||||||
ret = WOLFSSL_BAD_FILE;
|
ret = WOLFSSL_BAD_FILE;
|
||||||
#else
|
#else
|
||||||
|
if (*keyFormat == 0) {
|
||||||
|
/* Format unknown so keep trying. */
|
||||||
ret = 0; /* continue trying other algorithms */
|
ret = 0; /* continue trying other algorithms */
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -6616,7 +6619,10 @@ static int ProcessBufferTryDecodeRsa(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
|
|||||||
"not enabled to try");
|
"not enabled to try");
|
||||||
ret = WOLFSSL_BAD_FILE;
|
ret = WOLFSSL_BAD_FILE;
|
||||||
#else
|
#else
|
||||||
|
if (*keyFormat == 0) {
|
||||||
|
/* Format unknown so keep trying. */
|
||||||
ret = 0; /* continue trying other algorithms */
|
ret = 0; /* continue trying other algorithms */
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -6728,7 +6734,7 @@ static int ProcessBufferTryDecodeEcc(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
|
|||||||
*resetSuites = 1;
|
*resetSuites = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (*keyFormat == 0) {
|
||||||
ret = 0; /* continue trying other algorithms */
|
ret = 0; /* continue trying other algorithms */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6809,7 +6815,7 @@ static int ProcessBufferTryDecodeEd25519(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (*keyFormat == 0) {
|
||||||
ret = 0; /* continue trying other algorithms */
|
ret = 0; /* continue trying other algorithms */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user