Commit d6b8be84 authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Jim Harris
Browse files

sock: add PSK len to impl_opts



PSKs are going to be passed around as binary data
starting with "nvme_tcp: generate retained PSK".

That means we cannot rely on strlen() function
to get the length of that data field inside
posix_sock_tls_psk_server_cb() and
posix_sock_tls_psk_client_cb() methods.

Change-Id: Ic0bbabf0e3342136f80b85a7d5d47aac69ab43d1
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16740


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1df4f4bb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -143,7 +143,12 @@ struct spdk_sock_impl_opts {
	/**
	 * Set default PSK key. Used by ssl socket module.
	 */
	char *psk_key;
	uint8_t *psk_key;

	/**
	 * Size of psk_key.
	 */
	uint32_t psk_key_size;

	/**
	 * Set default PSK identity. Used by ssl socket module.
+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ static struct spdk_sock_impl_opts g_spdk_posix_sock_impl_opts = {
	.tls_version = 0,
	.enable_ktls = false,
	.psk_key = NULL,
	.psk_key_size = 0,
	.psk_identity = NULL,
	.get_key = NULL,
	.get_key_ctx = NULL
@@ -123,6 +124,7 @@ posix_sock_copy_impl_opts(struct spdk_sock_impl_opts *dest, const struct spdk_so
	SET_FIELD(tls_version);
	SET_FIELD(enable_ktls);
	SET_FIELD(psk_key);
	SET_FIELD(psk_key_size);
	SET_FIELD(psk_identity);
	SET_FIELD(get_key);
	SET_FIELD(get_key_ctx);