Refactor: remove incorrect check against NULL , passwd and cipher can be NULL

This commit is contained in:
Roy Carter
2026-04-26 17:37:34 +03:00
parent 96e966e779
commit e638f8ec61
+1 -5
View File
@@ -6351,11 +6351,6 @@ int wolfSSL_PEM_write_PrivateKey(XFILE fp, WOLFSSL_EVP_PKEY* key,
err = 1;
}
if ((!err) && ((cipher != NULL) || (passwd != NULL) || (len != 0) ||
(cb != NULL) || (arg != NULL))) {
WOLFSSL_MSG("PEM private key encryption not supported here");
}
if (!err) {
/* Set PEM type based on key type, inverse of PEM_read_PrivateKey. */
switch (key->type) {
@@ -6394,6 +6389,7 @@ int wolfSSL_PEM_write_PrivateKey(XFILE fp, WOLFSSL_EVP_PKEY* key,
fp, type, NULL) != 1)) {
err = 1;
}
WOLFSSL_LEAVE("wolfSSL_PEM_write_PrivateKey", err);