Fixes for default build with no keygen enabled
parent
f4b500c5fa
commit
dd3a985fbe
|
@ -116,7 +116,7 @@ int wolfCLU_decrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
|
|||
/* replicates old pwdKey if pwdKeys match */
|
||||
if (keyType == 1) {
|
||||
if (wc_PBKDF2(key, pwdKey, (int) strlen((const char*)pwdKey), salt,
|
||||
SALT_SIZE, 4096, size, SHA256) != 0) {
|
||||
SALT_SIZE, 4096, size, WC_SHA256) != 0) {
|
||||
printf("pwdKey set error.\n");
|
||||
wolfCLU_freeBins(input, output, NULL, NULL, NULL);
|
||||
return ENCRYPT_ERROR;
|
||||
|
|
|
@ -421,6 +421,9 @@ int wolfCLU_genKey_RSA(RNG* rng, char* fName, int directive, int fmt, int
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_KEY_GEN && !NO_ASN*/
|
||||
|
||||
|
||||
/*
|
||||
* makes a cyptographically secure key by stretching a user entered pwdKey
|
||||
*/
|
||||
|
@ -443,11 +446,10 @@ int wolfCLU_genKey_PWDBASED(RNG* rng, byte* pwdKey, int size, byte* salt, int pa
|
|||
|
||||
/* stretches pwdKey */
|
||||
ret = (int) wc_PBKDF2(pwdKey, pwdKey, (int) strlen((const char*)pwdKey), salt, SALT_SIZE,
|
||||
4096, size, SHA256);
|
||||
4096, size, WC_SHA256);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_KEY_GEN && !NO_ASN*/
|
||||
|
|
|
@ -112,7 +112,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
|
|||
#endif /* HAVE_ED25519 */
|
||||
|
||||
} else if (XSTRNCMP(keyType, "ecc", 3) == 0) {
|
||||
#ifdef HAVE_ECC
|
||||
#if defined(HAVE_ECC) && defined(WOLFSSL_KEY_GEN)
|
||||
/* ECC flags */
|
||||
int directiveArg;
|
||||
int sizeArg;
|
||||
|
@ -173,7 +173,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
|
|||
return NOT_COMPILED_IN;
|
||||
#endif /* HAVE_ECC */
|
||||
} else if (XSTRNCMP(keyType, "rsa", 3) == 0) {
|
||||
#ifndef NO_RSA
|
||||
#if defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
|
||||
/* RSA flags */
|
||||
int directiveArg;
|
||||
int sizeArg;
|
||||
|
|
Loading…
Reference in New Issue