diff options
| author | Eric Biggers <ebiggers@google.com> | 2025-05-13 21:50:34 -0700 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-05-25 22:54:50 -0500 |
| commit | eb21736021865112f8e1bec20fe55f995bc4e771 (patch) | |
| tree | 65d6ed57067f40131399896f5304f98f194fbd8b /fs/smb/server/auth.c | |
| parent | 0ff41df1cb268fc69e703a08a57ee14ae967d0ca (diff) | |
| download | linux-eb21736021865112f8e1bec20fe55f995bc4e771.tar.gz linux-eb21736021865112f8e1bec20fe55f995bc4e771.tar.bz2 linux-eb21736021865112f8e1bec20fe55f995bc4e771.zip | |
ksmbd: use SHA-256 library API instead of crypto_shash API
ksmbd_gen_sd_hash() does not support any other algorithm, so the
crypto_shash abstraction provides no value. Just use the SHA-256
library API instead, which is much simpler and easier to use.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.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 | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index b3d121052408..d99871c21451 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -979,40 +979,6 @@ out: return rc; } -int ksmbd_gen_sd_hash(struct ksmbd_conn *conn, char *sd_buf, int len, - __u8 *pi_hash) -{ - int rc; - struct ksmbd_crypto_ctx *ctx = NULL; - - ctx = ksmbd_crypto_ctx_find_sha256(); - if (!ctx) { - ksmbd_debug(AUTH, "could not alloc sha256\n"); - return -ENOMEM; - } - - rc = crypto_shash_init(CRYPTO_SHA256(ctx)); - if (rc) { - ksmbd_debug(AUTH, "could not init shashn"); - goto out; - } - - rc = crypto_shash_update(CRYPTO_SHA256(ctx), sd_buf, len); - if (rc) { - ksmbd_debug(AUTH, "could not update with n\n"); - goto out; - } - - rc = crypto_shash_final(CRYPTO_SHA256(ctx), pi_hash); - if (rc) { - ksmbd_debug(AUTH, "Could not generate hash err : %d\n", rc); - goto out; - } -out: - ksmbd_release_crypto_ctx(ctx); - return rc; -} - static int ksmbd_get_encryption_key(struct ksmbd_work *work, __u64 ses_id, int enc, u8 *key) { |
