Merge pull request #91 from kaleb-himes/CLU-FIX
Fixes for default build with no keygen enabledpull/92/head
commit
4896ddbf25
|
@ -116,7 +116,7 @@ int wolfCLU_decrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
|
||||||
/* replicates old pwdKey if pwdKeys match */
|
/* replicates old pwdKey if pwdKeys match */
|
||||||
if (keyType == 1) {
|
if (keyType == 1) {
|
||||||
if (wc_PBKDF2(key, pwdKey, (int) strlen((const char*)pwdKey), salt,
|
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");
|
printf("pwdKey set error.\n");
|
||||||
wolfCLU_freeBins(input, output, NULL, NULL, NULL);
|
wolfCLU_freeBins(input, output, NULL, NULL, NULL);
|
||||||
return ENCRYPT_ERROR;
|
return ENCRYPT_ERROR;
|
||||||
|
|
|
@ -421,6 +421,9 @@ int wolfCLU_genKey_RSA(RNG* rng, char* fName, int directive, int fmt, int
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* WOLFSSL_KEY_GEN && !NO_ASN*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* makes a cyptographically secure key by stretching a user entered pwdKey
|
* 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 */
|
/* stretches pwdKey */
|
||||||
ret = (int) wc_PBKDF2(pwdKey, pwdKey, (int) strlen((const char*)pwdKey), salt, SALT_SIZE,
|
ret = (int) wc_PBKDF2(pwdKey, pwdKey, (int) strlen((const char*)pwdKey), salt, SALT_SIZE,
|
||||||
4096, size, SHA256);
|
4096, size, WC_SHA256);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WOLFSSL_KEY_GEN && !NO_ASN*/
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
|
||||||
#endif /* HAVE_ED25519 */
|
#endif /* HAVE_ED25519 */
|
||||||
|
|
||||||
} else if (XSTRNCMP(keyType, "ecc", 3) == 0) {
|
} else if (XSTRNCMP(keyType, "ecc", 3) == 0) {
|
||||||
#ifdef HAVE_ECC
|
#if defined(HAVE_ECC) && defined(WOLFSSL_KEY_GEN)
|
||||||
/* ECC flags */
|
/* ECC flags */
|
||||||
int directiveArg;
|
int directiveArg;
|
||||||
int sizeArg;
|
int sizeArg;
|
||||||
|
@ -173,7 +173,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
|
||||||
return NOT_COMPILED_IN;
|
return NOT_COMPILED_IN;
|
||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
} else if (XSTRNCMP(keyType, "rsa", 3) == 0) {
|
} else if (XSTRNCMP(keyType, "rsa", 3) == 0) {
|
||||||
#ifndef NO_RSA
|
#if defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
|
||||||
/* RSA flags */
|
/* RSA flags */
|
||||||
int directiveArg;
|
int directiveArg;
|
||||||
int sizeArg;
|
int sizeArg;
|
||||||
|
|
Loading…
Reference in New Issue