Conf file is now in source tree
[mod_auth_kerb.git] / mod_auth_gssapi.c
index fb14416..32c0f01 100644 (file)
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 2010 CESNET
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of CESNET nor the names of its contributors may
+ *    be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "mod_auth_gssapi.h"
 
 module AP_MODULE_DECLARE_DATA auth_gssapi_module;
@@ -51,8 +82,8 @@ set_http_headers(request_rec *r, const gss_auth_config *conf,
     if (negotiate_ret_value == NULL)
        return;
 
-    negoauth_param = (*negotiate_ret_value == '\0') ? "GSSAPI" :
-        apr_pstrcat(r->pool, "GSSAPI ", negotiate_ret_value, NULL);
+    negoauth_param = (*negotiate_ret_value == '\0') ? "Negotiate" :
+        apr_pstrcat(r->pool, "Negotiate ", negotiate_ret_value, NULL);
     apr_table_add(r->err_headers_out, header_name, negoauth_param);
 }
 
@@ -106,7 +137,7 @@ gss_authenticate_user(request_rec *r)
    
     /* get the type specified in Apache configuration */
     type = ap_auth_type(r);
-    if (type == NULL || strcmp(type, "GSSAPI") != 0) {
+    if (type == NULL || strcmp(type, "Negotiate") != 0) {
         gss_log(APLOG_MARK, APLOG_DEBUG, 0, r,
                "AuthType '%s' is not for us, bailing out",
                (type) ? type : "(NULL)");
@@ -126,7 +157,7 @@ gss_authenticate_user(request_rec *r)
     }
 
     auth_type = ap_getword_white(r->pool, &auth_line);
-    if (strcasecmp(auth_type, "GSSAPI") != 0) {
+    if (strcasecmp(auth_type, "Negotiate") != 0) {
         gss_log(APLOG_MARK, APLOG_DEBUG, 0, r,
                "Unsupported authentication type (%s) requested by client",
                (auth_type) ? auth_type : "(NULL)");
@@ -144,14 +175,14 @@ gss_authenticate_user(request_rec *r)
     /* optimizing hack */
     if (conn_ctx->state == GSS_CTX_ESTABLISHED && auth_line == NULL) {
        r->user = apr_pstrdup(r->pool, conn_ctx->user);
-       r->ap_auth_type = "GSSAPI";
+       r->ap_auth_type = "Negotiate";
        return OK;
     }
 
     /* XXXX subrequests ignored, only successful accesses taken into account! */
     if (!ap_is_initial_req(r) && conn_ctx->state == GSS_CTX_ESTABLISHED) {
        r->user = apr_pstrdup(r->pool, conn_ctx->user);
-       r->ap_auth_type = "GSSAPI";
+       r->ap_auth_type = "Negotiate";
        return OK;
     }
 
@@ -164,7 +195,7 @@ gss_authenticate_user(request_rec *r)
 
     if (ret == OK) {
        r->user = apr_pstrdup(r->pool, conn_ctx->user);
-       r->ap_auth_type = "GSSAPI";
+       r->ap_auth_type = "Negotiate";
     }
 
     /* debug LOG ??? */