Commit d2fec01e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '6.16-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server updates from Steve French:
 "Four smb3 server fixes:

   - Fix for special character handling when mounting with "posix"

   - Fix for mounts from Mac for fs that don't provide unique inode
     numbers

   - Two cleanup patches (e.g. for crypto calls)"

* tag '6.16-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: allow a filename to contain special characters on SMB3.1.1 posix extension
  ksmbd: provide zero as a unique ID to the Mac client
  ksmbd: remove unnecessary softdep on crc32
  ksmbd: use SHA-256 library API instead of crypto_shash API
parents ff0905bb dc3e0f17
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ config SMB_SERVER
	select CRYPTO_HMAC
	select CRYPTO_ECB
	select CRYPTO_LIB_DES
	select CRYPTO_LIB_SHA256
	select CRYPTO_SHA256
	select CRYPTO_CMAC
	select CRYPTO_SHA512
+0 −34
Original line number Diff line number Diff line
@@ -979,40 +979,6 @@ int ksmbd_gen_preauth_integrity_hash(struct ksmbd_conn *conn, char *buf,
	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)
{
+0 −2
Original line number Diff line number Diff line
@@ -66,6 +66,4 @@ int ksmbd_gen_smb311_encryptionkey(struct ksmbd_conn *conn,
				   struct ksmbd_session *sess);
int ksmbd_gen_preauth_integrity_hash(struct ksmbd_conn *conn, char *buf,
				     __u8 *pi_hash);
int ksmbd_gen_sd_hash(struct ksmbd_conn *conn, char *sd_buf, int len,
		      __u8 *pi_hash);
#endif
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ struct ksmbd_conn {
	__le16				signing_algorithm;
	bool				binding;
	atomic_t			refcnt;
	bool				is_aapl;
};

struct ksmbd_conn_ops {
+0 −8
Original line number Diff line number Diff line
@@ -75,9 +75,6 @@ static struct shash_desc *alloc_shash_desc(int id)
	case CRYPTO_SHASH_CMACAES:
		tfm = crypto_alloc_shash("cmac(aes)", 0, 0);
		break;
	case CRYPTO_SHASH_SHA256:
		tfm = crypto_alloc_shash("sha256", 0, 0);
		break;
	case CRYPTO_SHASH_SHA512:
		tfm = crypto_alloc_shash("sha512", 0, 0);
		break;
@@ -198,11 +195,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void)
	return ____crypto_shash_ctx_find(CRYPTO_SHASH_CMACAES);
}

struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void)
{
	return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA256);
}

struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void)
{
	return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512);
Loading