Commit 94096702 authored by Namjae Jeon's avatar Namjae Jeon

cifsd: move fips_enabled check before the str_to_key()

Move fips_enabled check before the str_to_key().
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 8bae4419
...@@ -92,14 +92,13 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) ...@@ -92,14 +92,13 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
unsigned char key2[8]; unsigned char key2[8];
struct des_ctx ctx; struct des_ctx ctx;
str_to_key(key, key2);
if (fips_enabled) { if (fips_enabled) {
ksmbd_debug(AUTH, ksmbd_debug(AUTH,
"FIPS compliance enabled: DES not permitted\n"); "FIPS compliance enabled: DES not permitted\n");
return -ENOENT; return -ENOENT;
} }
str_to_key(key, key2);
des_expand_key(&ctx, key2, DES_KEY_SIZE); des_expand_key(&ctx, key2, DES_KEY_SIZE);
des_encrypt(&ctx, out, in); des_encrypt(&ctx, out, in);
memzero_explicit(&ctx, sizeof(ctx)); memzero_explicit(&ctx, sizeof(ctx));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment