Skip to content

Commit 239ff5d

Browse files
committed
tlshd: Return a non-zero peerid
NFSD depends on seeing a non-zero peerid to know when the session has been authenticated (mTLS). Currently NFSD does not read or parse the remote peer's certificate. If tlshd fails to link the certificate onto the USER_SPEC keyring, it still needs to return a peerid that is non-zero to show that the remote peer presented a trusted certificate. Hack city. But this "fix" is compatible with older kernels and ktls-utils releases. A more complete fix is forthcoming. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent b8a754f commit 239ff5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tlshd/server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ static int tlshd_server_x509_verify_function(gnutls_session_t session,
224224
return GNUTLS_E_CERTIFICATE_ERROR;
225225
}
226226
peerid = tlshd_keyring_create_cert(cert, parms->peername);
227+
if (peerid == TLS_NO_PEERID)
228+
peerid = UINT_MAX;
227229
g_array_append_val(parms->remote_peerids, peerid);
228230
gnutls_x509_crt_deinit(cert);
229231
}

0 commit comments

Comments
 (0)