Skip to content

Unclear/incorrect understanding of mutual auth and context continuation #39

Open
@michael-o

Description

@michael-o

I am quite confused by the handling of mutual authentication and context continuation/completion. I don't take this as a solid argument because it does not mean that this module should not implement it correctly (regardless of TLS). mod_auth_gssapi perfectly works. My SpnegoAuthenticator fully respects it. I would expect this module to solely rely on the context continuation flag instead of the mutual flag to complete the context. I don't see any checks for continuation. In fact, even if mutual is disabled the server still sends a small token:
Modified curl:

$ git diff
diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c
index 5810dad14..1b9be62f3 100644
--- a/lib/curl_gssapi.c
+++ b/lib/curl_gssapi.c
@@ -51,9 +51,6 @@ OM_uint32 Curl_gss_init_sec_context(
 {
   OM_uint32 req_flags = GSS_C_REPLAY_FLAG;

-  if(mutual_auth)
-    req_flags |= GSS_C_MUTUAL_FLAG;
-
   if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_POLICY_FLAG) {
 #ifdef GSS_C_DELEG_POLICY_FLAG
     req_flags |= GSS_C_DELEG_POLICY_FLAG;

Against mod_auth_gssapi:

$ LD_LIBRARY_PATH=/tmp/curl/lib  /tmp/curl/bin/curl   -X HEAD --verbose  https://deblndw011x.ad001.siemens.net/repos/websvn/ -k --negotiate -u :
* Server auth using Negotiate with user ''
> HEAD /repos/websvn/ HTTP/1.1
> Host: deblndw011x.ad001.siemens.net
> Authorization: Negotiate YIIMjQYGKwYBBQUCoIIMgTCCDH2gDTALBgkqh...
> User-Agent: curl/7.79.0-DEV
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Thu, 12 Aug 2021 09:28:54 GMT
< Server: Apache
* Negotiate: noauthpersist -> 0, header part: true
< Persistent-Auth: true
< WWW-Authenticate: Negotiate oRQwEqADCgEAoQsGCSqGSIb3EgECAg==
< X-Frame-Options: SAMEORIGIN
< X-Powered-By: PHP/7.4.21
< Content-Language: de
< Content-Type: text/html; charset=UTF-8
* no chunk, no close, no size. Assume close to signal end
<

same with vanilla curl:

$ curl   -X HEAD --verbose  https://deblndw011x.ad001.siemens.net/repos/websvn/ -k --negotiate -u :
* Server auth using Negotiate with user ''
> HEAD /repos/websvn/ HTTP/1.1
> Host: deblndw011x.ad001.siemens.net
> Authorization: Negotiate YIIMjQYGKwYBBQUCoIIM...
> User-Agent: curl/7.78.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Thu, 12 Aug 2021 09:30:19 GMT
< Server: Apache
* Negotiate: noauthpersist -> 0, header part: true
< Persistent-Auth: true
< WWW-Authenticate: Negotiate oYG3MIG0oAMKAQChCwYJKoZIhvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvvNAqhdgnvC0LXYN19pJxezVYDUN173D2KCPxe6mAIGDQdBFkh+4I9DNSyMlQ1UIXDHMUPu9VK931/lOSLpusjdu/mS42RWE95kp5uPxWhaQT6UmS1pTNLIB+rf78M3CE2oovKAD0TQyEb+3xrNji
< X-Frame-Options: SAMEORIGIN
< X-Powered-By: PHP/7.4.21
< Content-Language: de
< Content-Type: text/html; charset=UTF-8
* no chunk, no close, no size. Assume close to signal end
<

I am willing to provide a PR which uses this property, ironically written with your participation.

Checked also the source code of gss-client/gss-server they both use the continuation flag to complete a context based on RFC 7546.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions