mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
cifsd: move fips_enabled check before the str_to_key()
Move fips_enabled check before the str_to_key(). Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
8bae4419ce
commit
9409670237
1 changed files with 1 additions and 2 deletions
|
@ -92,14 +92,13 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
|
|||
unsigned char key2[8];
|
||||
struct des_ctx ctx;
|
||||
|
||||
str_to_key(key, key2);
|
||||
|
||||
if (fips_enabled) {
|
||||
ksmbd_debug(AUTH,
|
||||
"FIPS compliance enabled: DES not permitted\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
str_to_key(key, key2);
|
||||
des_expand_key(&ctx, key2, DES_KEY_SIZE);
|
||||
des_encrypt(&ctx, out, in);
|
||||
memzero_explicit(&ctx, sizeof(ctx));
|
||||
|
|
Loading…
Reference in a new issue