Skip to content

Commit 72d08cf

Browse files
committed
tlshd: fixup compile errors with HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2
Fixes the following compile errors when HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2 is enabled. ``` client.c:369:40: error: format ‘%c’ expects argument of type ‘char *’, but argument 4 has type ‘int *’ [-Werror=format=] 369 | if (sscanf(identity, "NVMe%01d%c%02d %*s", | ~^ | | | char * | %lc 370 | &version, &type, &hash) == 3) { | ~~~~~ | | | int * server.c: In function ‘tlshd_tls13_server_psk_handshake’: server.c:332:55: error: ‘GNUTLS_MAC_NONE’ undeclared (first use in this function); did you mean ‘GNUTLS_EXT_NONE’? 332 | GNUTLS_MAC_NONE); | ^~~~~~~~~~~~~~~ | GNUTLS_EXT_NONE ``` Fixes: a5a25e9 Signed-off-by: Wilfred Mallawa <[email protected]>
1 parent 59ecb97 commit 72d08cf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/tlshd/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ static void tlshd_tls13_client_psk_handshake_one(struct tlshd_handshake_parms *p
361361
gnutls_psk_client_credentials_t psk_cred;
362362
gnutls_session_t session;
363363
#ifdef HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2
364-
int version, type, hash;
364+
int version, hash;
365+
char type;
365366
#endif
366367
gnutls_datum_t key;
367368
unsigned int flags;

src/tlshd/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static void tlshd_tls13_server_psk_handshake(struct tlshd_handshake_parms *parms
372372

373373
#ifdef HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2
374374
ret = gnutls_psk_allocate_server_credentials2(&psk_cred,
375-
GNUTLS_MAC_NONE);
375+
GNUTLS_MAC_UNKNOWN);
376376
#else
377377
ret = gnutls_psk_allocate_server_credentials(&psk_cred);
378378
#endif

0 commit comments

Comments
 (0)