diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-09-06 20:20:03 -0700 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-09-07 21:45:34 -0500 |
| commit | c2b453ed23e1838ef9762b8a6861239dfaed6c1a (patch) | |
| tree | 0bbd622b8c6fa344fb3575912b15588314ad7b0c /fs/smb/server/auth.c | |
| parent | 12796098184b5d0afa54bead8f3e96f58df38f51 (diff) | |
| download | linux-c2b453ed23e1838ef9762b8a6861239dfaed6c1a.tar.gz linux-c2b453ed23e1838ef9762b8a6861239dfaed6c1a.tar.bz2 linux-c2b453ed23e1838ef9762b8a6861239dfaed6c1a.zip | |
smb: Use arc4 library instead of duplicate arc4 code
fs/smb/common/cifs_arc4.c has an implementation of ARC4, but a copy of
this same code is also present in lib/crypto/arc4.c to serve the other
users of this legacy algorithm in the kernel. Remove the duplicate
implementation in fs/smb/, which seems to have been added because of a
misunderstanding, and just use the lib/crypto/ one.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/server/auth.c')
| -rw-r--r-- | fs/smb/server/auth.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index d99871c21451..b4020bb55a26 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -20,6 +20,7 @@ #include "glob.h" #include <linux/fips.h> +#include <crypto/arc4.h> #include <crypto/des.h> #include "server.h" @@ -29,7 +30,6 @@ #include "mgmt/user_config.h" #include "crypto_ctx.h" #include "transport_ipc.h" -#include "../common/arc4.h" /* * Fixed format data defining GSS header and fixed string @@ -365,10 +365,9 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, if (!ctx_arc4) return -ENOMEM; - cifs_arc4_setkey(ctx_arc4, sess->sess_key, - SMB2_NTLMV2_SESSKEY_SIZE); - cifs_arc4_crypt(ctx_arc4, sess->sess_key, - (char *)authblob + sess_key_off, sess_key_len); + arc4_setkey(ctx_arc4, sess->sess_key, SMB2_NTLMV2_SESSKEY_SIZE); + arc4_crypt(ctx_arc4, sess->sess_key, + (char *)authblob + sess_key_off, sess_key_len); kfree_sensitive(ctx_arc4); } |
