Skip to content

Commit

Permalink
ksmbd: Remove CONFIG_CRYPTO_DES dependency when secure
Browse files Browse the repository at this point in the history
DES is generally considered insecure, remove dependency when running
without CONFIG_SMB_INSECURE_SERVER.

Signed-off-by: Marcus Carlberg <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Marcus Carlberg authored and namjaejeon committed Dec 2, 2024
1 parent 00e118b commit 5f6d8d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include "glob.h"

#include <linux/fips.h>
#ifdef CONFIG_SMB_INSECURE_SERVER
#include <crypto/des.h>
#endif

#include "server.h"
#include "smb_common.h"
Expand Down Expand Up @@ -67,7 +69,7 @@ void ksmbd_copy_gss_neg_header(void *buf)
{
memcpy(buf, NEGOTIATE_GSS_HEADER, AUTH_GSS_LENGTH);
}

#ifdef CONFIG_SMB_INSECURE_SERVER
static void
str_to_key(unsigned char *str, unsigned char *key)
{
Expand Down Expand Up @@ -149,7 +151,6 @@ static int ksmbd_enc_md4(unsigned char *md4_hash, unsigned char *link_str,
return rc;
}

#ifdef CONFIG_SMB_INSECURE_SERVER
static int ksmbd_enc_update_sess_key(unsigned char *md5_hash, char *nonce,
char *server_challenge, int len)
{
Expand Down Expand Up @@ -326,6 +327,7 @@ static int calc_ntlmv2_hash(struct ksmbd_conn *conn, struct ksmbd_session *sess,
return ret;
}

#ifdef CONFIG_SMB_INSECURE_SERVER
/**
* ksmbd_auth_ntlm() - NTLM authentication handler
* @sess: session of connection
Expand Down Expand Up @@ -362,6 +364,7 @@ int ksmbd_auth_ntlm(struct ksmbd_session *sess, char *pw_buf, char *cryptkey)
ksmbd_debug(AUTH, "ntlmv1 authentication pass\n");
return 0;
}
#endif

/**
* ksmbd_auth_ntlmv2() - NTLMv2 authentication handler
Expand Down

0 comments on commit 5f6d8d1

Please sign in to comment.