gss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gss branch, master, updated. gss-1-0-2-26-gbc53375


From: Simon Josefsson
Subject: [SCM] GNU gss branch, master, updated. gss-1-0-2-26-gbc53375
Date: Tue, 14 Aug 2012 14:51:40 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gss".

http://git.savannah.gnu.org/cgit/gss.git/commit/?id=bc53375e344205579e852b3e0215ebdf31ebd182

The branch, master has been updated
       via  bc53375e344205579e852b3e0215ebdf31ebd182 (commit)
       via  ce7b9ecd791bc1c536c0ff272b9aefe197962729 (commit)
       via  58f5eb127a404d6e6d99409d34df96d911d15a4a (commit)
      from  ddc99d9a4045851a3da5e33b1a98eab7ee4eebfb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bc53375e344205579e852b3e0215ebdf31ebd182
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 16:51:23 2012 +0200

    Fix non-shishi builds.

commit ce7b9ecd791bc1c536c0ff272b9aefe197962729
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 16:47:45 2012 +0200

    Find mechanism by looking at context token.

commit 58f5eb127a404d6e6d99409d34df96d911d15a4a
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 16:34:59 2012 +0200

    Ignore more.

-----------------------------------------------------------------------

Summary of changes:
 .gitignore       |    3 +++
 lib/asn1.c       |    8 +++++---
 lib/context.c    |   24 ++++++++++++++++++++----
 lib/internal.h   |    4 ++++
 tests/saslname.c |    2 --
 5 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3231a3d..9960a47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -232,6 +232,8 @@ src/gl/Makefile
 src/gl/Makefile.in
 src/gl/TAGS
 src/gl/arg-nonnull.h
+src/gl/base64.lo
+src/gl/base64.o
 src/gl/c++defs.h
 src/gl/getopt.h
 src/gl/getopt.lo
@@ -243,6 +245,7 @@ src/gl/link-warning.h
 src/gl/progname.lo
 src/gl/progname.o
 src/gl/string.h
+src/gl/sys/
 src/gl/tests/.deps/
 src/gl/tests/Makefile
 src/gl/tests/Makefile.in
diff --git a/lib/asn1.c b/lib/asn1.c
index 4bb101c..8cb7e84 100644
--- a/lib/asn1.c
+++ b/lib/asn1.c
@@ -192,7 +192,7 @@ gss_encapsulate_token (gss_const_buffer_t input_token,
   return GSS_S_COMPLETE;
 }
 
-static int
+int
 _gss_decapsulate_token (const char *in, size_t inlen,
                        char **oid, size_t * oidlen,
                        char **out, size_t * outlen)
@@ -238,8 +238,10 @@ _gss_decapsulate_token (const char *in, size_t inlen,
   inlen -= asn1lenlen;
   in += asn1lenlen;
 
-  *outlen = inlen;
-  *out = (char *) in;
+  if (outlen)
+    *outlen = inlen;
+  if (out)
+    *out = (char *) in;
 
   return 0;
 }
diff --git a/lib/context.c b/lib/context.c
index c031f76..0f8c086 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -705,12 +705,28 @@ gss_accept_sec_context (OM_uint32 * minor_status,
 
   if (*context_handle == GSS_C_NO_CONTEXT)
     {
-      /* FIXME: We should extract GSS-API mechanism OID from token
-         here, and use it to find the proper mechanism. */
-      mech = _gss_find_mech (GSS_C_NO_OID);
+      char *oid;
+      size_t oidlen;
+      gss_OID_desc oidbuf;
+      int rc;
+
+      rc = _gss_decapsulate_token (input_token_buffer->value,
+                                  input_token_buffer->length,
+                                  &oid, &oidlen, NULL, NULL);
+      if (rc != 0)
+       {
+         if (minor_status)
+           *minor_status = 0;
+         return GSS_S_DEFECTIVE_TOKEN;
+       }
+
+      oidbuf.elements = oid;
+      oidbuf.length = oidlen;
+
+      mech = _gss_find_mech_no_default (&oidbuf);
     }
   else
-    mech = _gss_find_mech ((*context_handle)->mech);
+    mech = _gss_find_mech_no_default ((*context_handle)->mech);
   if (mech == NULL)
     {
       if (minor_status)
diff --git a/lib/internal.h b/lib/internal.h
index 2229796..81838db 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -71,5 +71,9 @@ _gss_encapsulate_token_prefix (const char *prefix, size_t 
prefixlen,
                               const char *in, size_t inlen,
                               const char *oid, OM_uint32 oidlen,
                               void **out, size_t * outlen);
+extern int
+_gss_decapsulate_token (const char *in, size_t inlen,
+                       char **oid, size_t * oidlen,
+                       char **out, size_t * outlen);
 
 #endif /* _INTERNAL_H */
diff --git a/tests/saslname.c b/tests/saslname.c
index e6f650d..cf8c7b0 100644
--- a/tests/saslname.c
+++ b/tests/saslname.c
@@ -38,9 +38,7 @@ main (int argc, char *argv[])
 {
   gss_uint32 maj_stat, min_stat;
   gss_buffer_desc bufdesc;
-#ifdef USE_KERBEROS5
   gss_OID oid;
-#endif
 
   do
     if (strcmp (argv[argc - 1], "-v") == 0 ||


hooks/post-receive
-- 
GNU gss



reply via email to

[Prev in Thread] Current Thread [Next in Thread]