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-0-1-5-15-g6d5bcae


From: Simon Josefsson
Subject: [SCM] GNU gss branch, master, updated. gss-0-1-5-15-g6d5bcae
Date: Fri, 26 Mar 2010 01:57:50 +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=6d5bcae700885d765b23044f0a5593108bcc0457

The branch, master has been updated
       via  6d5bcae700885d765b23044f0a5593108bcc0457 (commit)
       via  a1df0a1faec3868c1f43a63f69fd85bccfba0de9 (commit)
       via  dcc44e01405050acc0c150f44177dfde15470b70 (commit)
       via  86cf19cdb8db9fc423c4bead11d81621f1134220 (commit)
       via  03bb0742ee0600b5d20dea9cf46bcbd4816944cc (commit)
       via  f3769cc26a8ebc70019c68b0b715b778be20423a (commit)
       via  940cdafb9d79d8f1cb2b28eb912d571a45946341 (commit)
       via  508dd33825c1e19be5c5139ff4975340316ec9c4 (commit)
       via  7f6545306187d07d8177f7d6f8cc57ddab5fe1c5 (commit)
       via  309292d4864587fc25126926d7ef6de97ca3151b (commit)
       via  029557d177f8dd0d2213b3ae2bb9ccd36ee5a9ed (commit)
       via  7e6ae3702cfd0fe684e5896e3e974af72bfb2078 (commit)
      from  c72e59a23ff063da1936e37ecf9eb3a9839e2e66 (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 6d5bcae700885d765b23044f0a5593108bcc0457
Author: Simon Josefsson <address@hidden>
Date:   Fri Mar 26 02:56:40 2010 +0100

    Cleanup code.

commit a1df0a1faec3868c1f43a63f69fd85bccfba0de9
Author: Simon Josefsson <address@hidden>
Date:   Fri Mar 26 02:56:06 2010 +0100

    Cleanup.

commit dcc44e01405050acc0c150f44177dfde15470b70
Author: Simon Josefsson <address@hidden>
Date:   Fri Mar 26 02:53:18 2010 +0100

    Align capsulation APIs with new approach and update callers.

commit 86cf19cdb8db9fc423c4bead11d81621f1134220
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:24:53 2010 +0100

    Drop Since gtk-doc stuff.

commit 03bb0742ee0600b5d20dea9cf46bcbd4816944cc
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:13:39 2010 +0100

    Doc updates for v1.0.0.

commit f3769cc26a8ebc70019c68b0b715b778be20423a
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:11:10 2010 +0100

    Doc fix.

commit 940cdafb9d79d8f1cb2b28eb912d571a45946341
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:10:42 2010 +0100

    Drop gss_copy_oid.

commit 508dd33825c1e19be5c5139ff4975340316ec9c4
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:08:59 2010 +0100

    Update documentation for removed APIs.  Fix internal use of gss_copy_oid.

commit 7f6545306187d07d8177f7d6f8cc57ddab5fe1c5
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:06:54 2010 +0100

    Bump version.

commit 309292d4864587fc25126926d7ef6de97ca3151b
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:04:42 2010 +0100

    Drop bad extension functions and fix capsulate functions.
    
    Drop gss_copy_oid, gss_duplicate_oid, and gss_encapsulate_token_prefix.
    Align gss_encapsulate_token and gss_decapsulate_token with
    draft-josefsson-gss-capsulate-00.txt.

commit 029557d177f8dd0d2213b3ae2bb9ccd36ee5a9ed
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 18:03:18 2010 +0100

    Bump version and drop bad extension functions.
    
    The dropped functions are gss_copy_oid, gss_duplicate_oid, and
    gss_encapsulate_token_prefix.

commit 7e6ae3702cfd0fe684e5896e3e974af72bfb2078
Author: Simon Josefsson <address@hidden>
Date:   Thu Mar 25 17:52:45 2010 +0100

    Bump version, break API/ABI compatibility.

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

Summary of changes:
 NEWS                        |   16 ++++-
 configure.ac                |    8 +-
 doc/gss.texi                |   10 +--
 doc/reference/gss-docs.sgml |    6 --
 lib/asn1.c                  |  144 +++++++++++++++++++++----------------------
 lib/error.c                 |    8 +--
 lib/ext.c                   |  100 ------------------------------
 lib/headers/gss.h.in        |   10 +---
 lib/headers/gss/ext.h       |   25 +++-----
 lib/internal.h              |   13 ++++
 lib/krb5/context.c          |  101 +++++++++++++++++-------------
 lib/krb5/error.c            |    8 +--
 lib/krb5/msg.c              |   51 ++++++++--------
 lib/libgss.map              |   32 ++++------
 lib/meta.c                  |    5 --
 lib/misc.c                  |   49 ++++++++++++++-
 lib/saslname.c              |    8 ---
 tests/krb5context.c         |   33 ++++++++++
 18 files changed, 293 insertions(+), 334 deletions(-)

diff --git a/NEWS b/NEWS
index fb9730a..e1a78ea 100644
--- a/NEWS
+++ b/NEWS
@@ -2,10 +2,22 @@ GSS NEWS -- History of user-visible changes.                  
  -*- outline -*-
 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Simon Josefsson
 See the end for copying conditions.
 
-* Version 0.1.6 (unreleased)
+* Version 1.0.0 (unreleased)
+
+** Rarely used GNU GSS extensions removed.
+The removed APIs are gss_copy_oid, gss_duplicate_oid, and
+gss_encapsulate_token_prefix.
+
+** Align capsulation functions with Heimdal and specification document.
+The functions are gss_encapsulate_token and gss_decapsulate_token.
+The semantics and function prototypes changed slightly.
 
 ** API and ABI modifications.
-No changes since last version.
+gss_copy_oid: REMOVED.
+gss_duplicate_oid: REMOVED.
+gss_encapsulate_token_prefix: REMOVED.
+gss_encapsulate_token: MODIFIED.
+gss_decapsulate_token: MODIFIED.
 
 * Version 0.1.5 (released 2010-03-22)
 
diff --git a/configure.ac b/configure.ac
index 7cd3416..cc42c28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,15 +20,15 @@ dnl Process this file with autoconf to produce a configure 
script.
 # Boston, MA 02110-1301, USA.
 
 AC_PREREQ(2.61)
-AC_INIT([GNU Generic Security Service], [0.1.6], address@hidden, [gss])
+AC_INIT([GNU Generic Security Service], [1.0.0], address@hidden, [gss])
 
 # Library code modified:                              REVISION++
 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
-AC_SUBST(LT_CURRENT, 2)
-AC_SUBST(LT_REVISION, 1)
-AC_SUBST(LT_AGE, 1)
+AC_SUBST(LT_CURRENT, 3)
+AC_SUBST(LT_REVISION, 0)
+AC_SUBST(LT_AGE, 0)
 
 # Used when creating libgss-XX.def.
 DLL_VERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
diff --git a/doc/gss.texi b/doc/gss.texi
index 37591ce..6fe4a61 100644
--- a/doc/gss.texi
+++ b/doc/gss.texi
@@ -360,7 +360,7 @@ memory or size optimization.
 If you are interested, please write to:
 
 @verbatim
-Simon Josefsson Datakonsult
+Simon Josefsson Datakonsult AB
 Hagagatan 24
 113 47 Stockholm
 Sweden
@@ -378,7 +378,7 @@ be mentioned here, contact the author (@pxref{Bug Reports}).
 
 The package can be downloaded from several places, including:
 
address@hidden://alpha.gnu.org/pub/gnu/gss/}
address@hidden://ftp.gnu.org/gnu/gss/}
 
 The latest version is stored in a file, e.g.,
 @address@hidden where the @address@hidden
@@ -394,7 +394,7 @@ and installs the package.  You will need a few basic tools, 
such as
 @samp{sh}, @samp{make} and @samp{cc}.
 
 @example
-$ wget -q ftp://alpha.gnu.org/pub/gnu/gss/address@hidden
+$ wget -q ftp://ftp.gnu.org/gnu/gss/address@hidden
 $ tar xfz address@hidden
 $ cd address@hidden/
 $ ./configure
@@ -518,8 +518,6 @@ This would be an API extension.  It could work by forking a 
process
 and interface to it, or by using a user-specific daemon.  E.g., h =
 START(accept_sec_context(...)), FINISHED(h), ret = FINISH(h), ABORT(h).
 
address@hidden Compute MD5 of non-empty channel bindings.
-
 @item Support loadable modules via dlopen, a'la Solaris GSS.
 
 @item Port to Cyclone? CCured?
@@ -1497,8 +1495,6 @@ such, they are not declared in @file{gss/api.h}, but 
rather in
 
 @include texi/gss_check_version.texi
 @include texi/gss_oid_equal.texi
address@hidden texi/gss_copy_oid.texi
address@hidden texi/gss_duplicate_oid.texi
 @include texi/gss_userok.texi
 
 @deftypefun {int} gss_encapsulate_token (gss_buffer_t @var{input_message}, 
gss_OID @var{token_oid}, gss_buffer_t @var{output_message})
diff --git a/doc/reference/gss-docs.sgml b/doc/reference/gss-docs.sgml
index 1e7dd9e..38c8ac0 100644
--- a/doc/reference/gss-docs.sgml
+++ b/doc/reference/gss-docs.sgml
@@ -39,10 +39,4 @@
   <index id="api-index-full">
     <title>Index of all symbols</title>
   </index>
-  <index role="0.1.0" id="api-index-0-1-0">
-    <title>Index of new symbols in 0.1.0</title>
-  </index>
-  <index role="0.1.4" id="api-index-0-1-4">
-    <title>Index of new symbols in 0.1.4</title>
-  </index>
 </book>
diff --git a/lib/asn1.c b/lib/asn1.c
index c668099..31e9ee4 100644
--- a/lib/asn1.c
+++ b/lib/asn1.c
@@ -103,24 +103,27 @@ _gss_asn1_get_length_der (const char *der, size_t 
der_len, size_t *len)
     }
 }
 
-static int
-_gss_encapsulate_token (const char *oid, size_t oidlen,
-                       const char *in, size_t inlen,
-                       void **out, size_t * outlen)
+OM_uint32
+_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)
 {
   size_t oidlenlen;
   size_t asn1len, asn1lenlen;
   unsigned char *p;
 
+  if (prefix == NULL)
+    prefixlen = 0;
+
   _gss_asn1_length_der (oidlen, NULL, &oidlenlen);
-  asn1len = 1 + oidlenlen + oidlen + inlen;
+  asn1len = 1 + oidlenlen + oidlen + prefixlen + inlen;
   _gss_asn1_length_der (asn1len, NULL, &asn1lenlen);
 
   *outlen = 1 + asn1lenlen + asn1len;
-  p = malloc (*outlen);
+  p = *out = malloc (*outlen);
   if (!p)
-    return 0;
-  *out = p;
+    return -1;
 
   *p++ = '\x60';
   _gss_asn1_length_der (asn1len, p, &asn1lenlen);
@@ -130,55 +133,41 @@ _gss_encapsulate_token (const char *oid, size_t oidlen,
   p += oidlenlen;
   memcpy (p, oid, oidlen);
   p += oidlen;
+  if (prefixlen > 0)
+    {
+      memcpy (p, prefix, prefixlen);
+      p += prefixlen;
+    }
   memcpy (p, in, inlen);
 
-  return 1;
+  return 0;
 }
 
-int
-gss_encapsulate_token (const gss_buffer_t input_message,
-                      gss_OID token_oid, gss_buffer_t output_message)
+extern OM_uint32
+gss_encapsulate_token (const gss_buffer_t input_token,
+                      const gss_OID token_oid,
+                      gss_buffer_t output_token)
 {
-  if (!input_message)
+  int rc;
+
+  if (!input_token)
     return GSS_S_CALL_INACCESSIBLE_READ;
   if (!token_oid)
     return GSS_S_CALL_INACCESSIBLE_READ;
-  if (!output_message)
+  if (!output_token)
     return GSS_S_CALL_INACCESSIBLE_WRITE;
-  return _gss_encapsulate_token (token_oid->elements,
-                                token_oid->length,
-                                input_message->value,
-                                input_message->length,
-                                &output_message->value,
-                                &output_message->length);
-}
-
-int
-gss_encapsulate_token_prefix (const gss_buffer_t input_message,
-                             const char *prefix, size_t prefixlen,
-                             gss_OID token_oid, gss_buffer_t output_message)
-{
-  char *in;
-  size_t inlen;
-  int rc;
-
-  inlen = prefixlen + input_message->length;
-  in = malloc (inlen);
-  if (!in)
-    return 0;
-  memcpy (in, prefix, prefixlen);
-  memcpy (in + prefixlen, input_message->value, input_message->length);
-
-  rc = _gss_encapsulate_token (token_oid->elements,
-                              token_oid->length,
-                              in,
-                              inlen,
-                              &output_message->value,
-                              &output_message->length);
 
-  free (in);
-
-  return rc;
+  rc = _gss_encapsulate_token_prefix (NULL, 0,
+                                     input_token->value,
+                                     input_token->length,
+                                     token_oid->elements,
+                                     token_oid->length,
+                                     &output_token->value,
+                                     &output_token->length);
+  if (rc != 0)
+    return GSS_S_FAILURE;
+
+  return GSS_S_COMPLETE;
 }
 
 static int
@@ -190,36 +179,36 @@ _gss_decapsulate_token (const char *in, size_t inlen,
   size_t asn1lenlen;
 
   if (inlen-- == 0)
-    return 0;
+    return -1;
   if (*in++ != '\x60')
-    return 0;
+    return -1;
 
   i = inlen;
   asn1lenlen = _gss_asn1_get_length_der (in, inlen, &i);
   if (inlen < i)
-    return 0;
+    return -1;
 
   inlen -= i;
   in += i;
 
   if (inlen != asn1lenlen)
-    return 0;
+    return -1;
 
   if (inlen-- == 0)
-    return 0;
+    return -1;
   if (*in++ != '\x06')
-    return 0;
+    return -1;
 
   i = inlen;
   asn1lenlen = _gss_asn1_get_length_der (in, inlen, &i);
   if (inlen < i)
-    return 0;
+    return -1;
 
   inlen -= i;
   in += i;
 
   if (inlen < asn1lenlen)
-    return 0;
+    return -1;
 
   *oidlen = asn1lenlen;
   *oid = (char *) in;
@@ -230,34 +219,43 @@ _gss_decapsulate_token (const char *in, size_t inlen,
   *outlen = inlen;
   *out = (char *) in;
 
-  return 1;
+  return 0;
 }
 
-int
-gss_decapsulate_token (const gss_buffer_t input_message,
+OM_uint32
+gss_decapsulate_token (const gss_buffer_t input_token,
                       const gss_OID token_oid,
-                      char **dataptr, size_t * datalen)
+                      gss_buffer_t output_token)
 {
-  char *oid;
-  size_t oidlen;
-  int rc;
+  gss_OID_desc tmpoid;
+  char *oid = NULL, *out = NULL;
+  size_t oidlen = 0, outlen = 0;
 
-  if (!input_message)
+  if (!input_token)
     return GSS_S_CALL_INACCESSIBLE_READ;
   if (!token_oid)
     return GSS_S_CALL_INACCESSIBLE_READ;
-  if (!dataptr || !datalen)
+  if (!output_token)
     return GSS_S_CALL_INACCESSIBLE_WRITE;
 
-  rc = _gss_decapsulate_token (input_message->value,
-                              input_message->length,
-                              &oid, &oidlen, dataptr, datalen);
-  if (!rc)
-    return 0;
+  if (_gss_decapsulate_token ((char *) input_token->value,
+                             input_token->length,
+                             &oid, &oidlen,
+                             &out, &outlen) != 0)
+    return GSS_S_DEFECTIVE_TOKEN;
 
-  if (oidlen != token_oid->length ||
-      memcmp (oid, token_oid->elements, oidlen) != 0)
-    return 0;
+  tmpoid.length = oidlen;
+  tmpoid.elements = oid;
+
+  if (!gss_oid_equal (token_oid, &tmpoid))
+    return GSS_S_DEFECTIVE_TOKEN;
+
+  output_token->length = outlen;
+  output_token->value = malloc (outlen);
+  if (!output_token->value)
+    return GSS_S_FAILURE;
+
+  memcpy (output_token->value, out, outlen);
 
-  return 1;
+  return GSS_S_COMPLETE;
 }
diff --git a/lib/error.c b/lib/error.c
index 94de1b8..a3f5103 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -1,5 +1,5 @@
 /* error.c --- Error handling functionality.
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010  Simon Josefsson
  *
  * This file is part of the Generic Security Service (GSS).
  *
@@ -22,12 +22,6 @@
 
 #include "internal.h"
 
-/* Get i18n. */
-#include <gettext.h>
-#define _(String) dgettext (PACKAGE, String)
-#define gettext_noop(String) String
-#define N_(String) gettext_noop (String)
-
 /* _gss_find_mech */
 #include "meta.h"
 
diff --git a/lib/ext.c b/lib/ext.c
index 6053717..49881d3 100644
--- a/lib/ext.c
+++ b/lib/ext.c
@@ -40,7 +40,6 @@
 int
 gss_oid_equal (gss_OID first_oid, gss_OID second_oid)
 {
-
   return first_oid && second_oid &&
     first_oid->length == second_oid->length &&
     memcmp (first_oid->elements, second_oid->elements,
@@ -48,105 +47,6 @@ gss_oid_equal (gss_OID first_oid, gss_OID second_oid)
 }
 
 /**
- * gss_copy_oid:
- * @minor_status: (integer, modify) Mechanism specific status code.
- * @src_oid: (Object ID, read) The object identifier to copy.
- * @dest_oid: (Object ID, modify) The resultant copy of @src_oid.
- *   Storage associated with this name must be freed by the
- *   application, but gss_release_oid() cannot be used generally as it
- *   deallocate the oid structure itself too (use
- *   gss_duplicate_oid() if you don't want this problem.)
- *
- * Make an exact copy of the given OID, that shares no memory areas
- * with the original.
- *
- * WARNING: This function is a GNU GSS specific extension, and is not
- * part of the official GSS API.
- *
- * Return value:
- *
- * `GSS_S_COMPLETE`: Successful completion.
- **/
-OM_uint32
-gss_copy_oid (OM_uint32 * minor_status,
-             const gss_OID src_oid, gss_OID dest_oid)
-{
-  if (minor_status)
-    *minor_status = 0;
-
-  if (!src_oid)
-    return GSS_S_FAILURE | GSS_S_CALL_INACCESSIBLE_READ;
-
-  if (src_oid->length == 0 || src_oid->elements == NULL)
-    return GSS_S_FAILURE | GSS_S_CALL_BAD_STRUCTURE;
-
-  dest_oid->length = src_oid->length;
-  dest_oid->elements = malloc (src_oid->length);
-  if (!dest_oid->elements)
-    {
-      if (minor_status)
-       *minor_status = ENOMEM;
-      return GSS_S_FAILURE;
-    }
-  memcpy (dest_oid->elements, src_oid->elements, src_oid->length);
-
-  return GSS_S_COMPLETE;
-}
-
-/**
- * gss_duplicate_oid:
- * @minor_status: (integer, modify) Mechanism specific status code.
- * @src_oid: (Object ID, read) The object identifier to duplicate.
- * @dest_oid: (Object ID, modify) The resultant copy of @src_oid.
- *   Storage associated with this name must be freed by the
- *   application, by calling gss_release_oid().
- *
- * Allocate a new OID and make it an exact copy of the given OID, that
- * shares no memory areas with the original.
- *
- * WARNING: This function is a GNU GSS specific extension, and is not
- * part of the official GSS API.
- *
- * Return value:
- *
- * `GSS_S_COMPLETE`: Successful completion.
- **/
-OM_uint32
-gss_duplicate_oid (OM_uint32 * minor_status,
-                  const gss_OID src_oid, gss_OID * dest_oid)
-{
-  /* This function is not part of the official GSS API */
-
-  OM_uint32 maj_stat;
-
-  if (minor_status)
-    *minor_status = 0;
-
-  if (!src_oid)
-    return GSS_S_FAILURE | GSS_S_CALL_INACCESSIBLE_READ;
-
-  if (src_oid->length == 0 || src_oid->elements == NULL)
-    return GSS_S_FAILURE | GSS_S_CALL_BAD_STRUCTURE;
-
-  *dest_oid = malloc (sizeof (**dest_oid));
-  if (!*dest_oid)
-    {
-      if (minor_status)
-       *minor_status = ENOMEM;
-      return GSS_S_FAILURE;
-    }
-
-  maj_stat = gss_copy_oid (minor_status, src_oid, *dest_oid);
-  if (GSS_ERROR (maj_stat))
-    {
-      free (*dest_oid);
-      return maj_stat;
-    }
-
-  return GSS_S_COMPLETE;
-}
-
-/**
  * gss_userok:
  * @name: (gss_name_t, read) Name to be compared.
  * @username: Zero terminated string with username.
diff --git a/lib/headers/gss.h.in b/lib/headers/gss.h.in
index 265135f..2bb2742 100644
--- a/lib/headers/gss.h.in
+++ b/lib/headers/gss.h.in
@@ -1,5 +1,5 @@
 /* gss.h --- Header file for GSSLib.                                  -*- c -*-
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Simon 
Josefsson
  *
  * This file is part of the Generic Security Service (GSS).
  *
@@ -42,8 +42,6 @@ extern "C" {
    * Pre-processor symbol with a decimal value that describe the major
    * level of the header file version number.  For example, when the
    * header version is 1.2.3 this symbol will be 1.
-   *
-   * Since: 0.1.0
    */
 # define GSS_VERSION_MAJOR @VERSION_MAJOR@
 
@@ -53,8 +51,6 @@ extern "C" {
    * Pre-processor symbol with a decimal value that describe the minor
    * level of the header file version number.  For example, when the
    * header version is 1.2.3 this symbol will be 2.
-   *
-   * Since: 0.1.0
    */
 # define GSS_VERSION_MINOR @VERSION_MINOR@
 
@@ -64,8 +60,6 @@ extern "C" {
    * Pre-processor symbol with a decimal value that describe the patch
    * level of the header file version number.  For example, when the
    * header version is 1.2.3 this symbol will be 3.
-   *
-   * Since: 0.1.0
    */
 # define GSS_VERSION_PATCH @VERSION_PATCH@
 
@@ -75,8 +69,6 @@ extern "C" {
    * Pre-processor symbol with a hexadecimal value describing the
    * header file version number.  For example, when the header version
    * is 1.2.3 this symbol will have the value 0x010203.
-   *
-   * Since: 0.1.0
    */
 # define GSS_VERSION_NUMBER @VERSION_NUMBER@
 
diff --git a/lib/headers/gss/ext.h b/lib/headers/gss/ext.h
index cd74022..71f328d 100644
--- a/lib/headers/gss/ext.h
+++ b/lib/headers/gss/ext.h
@@ -1,5 +1,5 @@
 /* ext.h --- Header file for non-standard GSS-API functions.
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010  Simon Josefsson
  *
  * This file is part of the Generic Security Service (GSS).
  *
@@ -31,26 +31,17 @@ extern const char *gss_check_version (const char 
*req_version);
 
 /* See ext.c. */
 extern int gss_oid_equal (gss_OID first_oid, gss_OID second_oid);
-extern OM_uint32
-gss_copy_oid (OM_uint32 * minor_status,
-             const gss_OID src_oid, gss_OID dest_oid);
-extern OM_uint32
-gss_duplicate_oid (OM_uint32 * minor_status,
-                  const gss_OID src_oid, gss_OID * dest_oid);
 extern int gss_userok (const gss_name_t name, const char *username);
 
 /* See asn1.c. */
-extern int
-gss_encapsulate_token (const gss_buffer_t input_message,
-                      gss_OID token_oid, gss_buffer_t output_message);
-extern int
-gss_encapsulate_token_prefix (const gss_buffer_t input_message,
-                             const char *prefix, size_t prefixlen,
-                             gss_OID token_oid, gss_buffer_t output_message);
-extern int
-gss_decapsulate_token (const gss_buffer_t input_message,
+extern OM_uint32
+gss_encapsulate_token (const gss_buffer_t input_token,
+                      const gss_OID token_oid,
+                      gss_buffer_t output_token);
+extern OM_uint32
+gss_decapsulate_token (const gss_buffer_t input_token,
                       const gss_OID token_oid,
-                      char **dataptr, size_t * datalen);
+                      gss_buffer_t output_token);
 
 /* Static versions of the public OIDs for use, e.g., in static
    variable initalization.  See oid.c. */
diff --git a/lib/internal.h b/lib/internal.h
index 8e5be7e..262a80d 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -33,6 +33,12 @@
 #include <time.h>
 #include <errno.h>
 
+/* Get i18n. */
+#include <gettext.h>
+#define _(String) dgettext (PACKAGE, String)
+#define gettext_noop(String) String
+#define N_(String) gettext_noop (String)
+
 /* Get specification. */
 #include <gss.h>
 
@@ -59,4 +65,11 @@ typedef struct gss_ctx_id_struct
 #endif
 } gss_ctx_id_desc;
 
+/* asn1.c */
+extern OM_uint32
+_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);
+
 #endif /* _INTERNAL_H */
diff --git a/lib/krb5/context.c b/lib/krb5/context.c
index e84dbe7..2e54942 100644
--- a/lib/krb5/context.c
+++ b/lib/krb5/context.c
@@ -50,10 +50,9 @@ init_request (OM_uint32 * minor_status,
   gss_ctx_id_t ctx = *context_handle;
   _gss_krb5_ctx_t k5 = ctx->krb5;
   char *cksum, *der;
-  size_t cksumlen;
+  size_t cksumlen, derlen;
   int rc;
   OM_uint32 maj_stat;
-  gss_buffer_desc tmp;
   Shishi_tkts_hint hint;
 
   /* Get service ticket. */
@@ -96,16 +95,18 @@ init_request (OM_uint32 * minor_status,
   if (rc != SHISHI_OK)
     return GSS_S_FAILURE;
 
-  rc = shishi_ap_req_der (k5->ap, &der, &tmp.length);
+  rc = shishi_ap_req_der (k5->ap, &der, &derlen);
   if (rc != SHISHI_OK)
     return GSS_S_FAILURE;
 
-  tmp.value = der;
-
-  rc = gss_encapsulate_token_prefix (&tmp, TOK_AP_REQ, TOK_LEN,
-                                    GSS_KRB5, output_token);
+  rc = _gss_encapsulate_token_prefix (TOK_AP_REQ, TOK_LEN,
+                                     der, derlen,
+                                     GSS_KRB5->elements,
+                                     GSS_KRB5->length,
+                                     &output_token->value,
+                                     &output_token->length);
   free (der);
-  if (!rc)
+  if (rc != 0)
     return GSS_S_FAILURE;
 
   if (req_flags & GSS_C_MUTUAL_FLAG)
@@ -133,20 +134,28 @@ init_reply (OM_uint32 * minor_status,
 {
   gss_ctx_id_t ctx = *context_handle;
   _gss_krb5_ctx_t k5 = ctx->krb5;
-  char *data;
-  size_t datalen;
+  OM_uint32 tmp_min_stat;
+  gss_buffer_desc data;
   int rc;
 
-  if (!gss_decapsulate_token (input_token, GSS_KRB5, &data, &datalen))
+  if (gss_decapsulate_token (input_token, GSS_KRB5, &data) != GSS_S_COMPLETE)
     return GSS_S_DEFECTIVE_TOKEN;
 
-  if (datalen < TOK_LEN)
-    return GSS_S_DEFECTIVE_TOKEN;
+  if (data.length < TOK_LEN)
+    {
+      gss_release_buffer (&tmp_min_stat, &data);
+      return GSS_S_DEFECTIVE_TOKEN;
+    }
 
-  if (memcmp (data, TOK_AP_REP, TOK_LEN) != 0)
-    return GSS_S_DEFECTIVE_TOKEN;
+  if (memcmp (data.value, TOK_AP_REP, TOK_LEN) != 0)
+    {
+      gss_release_buffer (&tmp_min_stat, &data);
+      return GSS_S_DEFECTIVE_TOKEN;
+    }
 
-  rc = shishi_ap_rep_der_set (k5->ap, data + TOK_LEN, datalen - TOK_LEN);
+  rc = shishi_ap_rep_der_set (k5->ap, (char *) data.value + TOK_LEN,
+                             data.length - TOK_LEN);
+  gss_release_buffer (&tmp_min_stat, &data);
   if (rc != SHISHI_OK)
     return GSS_S_DEFECTIVE_TOKEN;
 
@@ -295,12 +304,11 @@ gss_krb5_accept_sec_context (OM_uint32 * minor_status,
                             OM_uint32 * time_rec,
                             gss_cred_id_t * delegated_cred_handle)
 {
-  gss_buffer_desc data;
-  char *in;
-  size_t inlen;
+  gss_buffer_desc in;
   gss_ctx_id_t cx;
   _gss_krb5_ctx_t cxk5;
   _gss_krb5_cred_t crk5;
+  OM_uint32 tmp_min_stat;
   int rc;
 
   if (minor_status)
@@ -348,17 +356,25 @@ gss_krb5_accept_sec_context (OM_uint32 * minor_status,
   if (rc != SHISHI_OK)
     return GSS_S_FAILURE;
 
-  rc = gss_decapsulate_token (input_token_buffer, GSS_KRB5, &in, &inlen);
-  if (!rc)
+  rc = gss_decapsulate_token (input_token_buffer, GSS_KRB5, &in);
+  if (rc != GSS_S_COMPLETE)
     return GSS_S_BAD_MIC;
 
-  if (inlen < TOK_LEN)
-    return GSS_S_BAD_MIC;
+  if (in.length < TOK_LEN)
+    {
+      gss_release_buffer (&tmp_min_stat, &in);
+      return GSS_S_BAD_MIC;
+    }
 
-  if (memcmp (in, TOK_AP_REQ, TOK_LEN) != 0)
-    return GSS_S_BAD_MIC;
+  if (memcmp (in.value, TOK_AP_REQ, TOK_LEN) != 0)
+    {
+      gss_release_buffer (&tmp_min_stat, &in);
+      return GSS_S_BAD_MIC;
+    }
 
-  rc = shishi_ap_req_der_set (cxk5->ap, in + TOK_LEN, inlen - TOK_LEN);
+  rc = shishi_ap_req_der_set (cxk5->ap, (char *) in.value + TOK_LEN,
+                             in.length - TOK_LEN);
+  gss_release_buffer (&tmp_min_stat, &in);
   if (rc != SHISHI_OK)
     return GSS_S_FAILURE;
 
@@ -388,6 +404,8 @@ gss_krb5_accept_sec_context (OM_uint32 * minor_status,
   if (shishi_apreq_mutual_required_p (crk5->sh, shishi_ap_req (cxk5->ap)))
     {
       Shishi_asn1 aprep;
+      char *der;
+      size_t len;
 
       rc = shishi_ap_rep_asn1 (cxk5->ap, &aprep);
       if (rc != SHISHI_OK)
@@ -408,23 +426,20 @@ gss_krb5_accept_sec_context (OM_uint32 * minor_status,
          cxk5->acceptseqnr = 0;
        }
 
-      {
-       char *der;
-       size_t len;
-
-       rc = shishi_asn1_to_der (crk5->sh, aprep, &der, &len);
-       if (rc != SHISHI_OK)
-         {
-           printf ("Error der encoding aprep: %s\n", shishi_strerror (rc));
-           return GSS_S_FAILURE;
-         }
-       data.value = der;
-       data.length = len;
-      }
-
-      rc = gss_encapsulate_token_prefix (&data, TOK_AP_REP, TOK_LEN,
-                                        GSS_KRB5, output_token);
-      if (!rc)
+      rc = shishi_asn1_to_der (crk5->sh, aprep, &der, &len);
+      if (rc != SHISHI_OK)
+       {
+         printf ("Error der encoding aprep: %s\n", shishi_strerror (rc));
+         return GSS_S_FAILURE;
+       }
+
+      rc = _gss_encapsulate_token_prefix (TOK_AP_REP, TOK_LEN,
+                                         der, len,
+                                         GSS_KRB5->elements,
+                                         GSS_KRB5->length,
+                                         &output_token->value,
+                                         &output_token->length);
+      if (rc != 0)
        return GSS_S_FAILURE;
 
       if (ret_flags)
diff --git a/lib/krb5/error.c b/lib/krb5/error.c
index a5a6f4d..dd638f7 100644
--- a/lib/krb5/error.c
+++ b/lib/krb5/error.c
@@ -1,5 +1,5 @@
 /* krb5/error.c --- Kerberos 5 GSS-API error handling functionality.
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Simon 
Josefsson
  *
  * This file is part of the Generic Security Service (GSS).
  *
@@ -23,12 +23,6 @@
 /* Get specification. */
 #include "k5internal.h"
 
-/* Get i18n. */
-#include <gettext.h>
-#define _(String) dgettext (PACKAGE, String)
-#define gettext_noop(String) String
-#define N_(String) gettext_noop (String)
-
 struct gss_status_codes
 {
   gss_uint32 err;
diff --git a/lib/krb5/msg.c b/lib/krb5/msg.c
index d11fee3..2d6d65d 100644
--- a/lib/krb5/msg.c
+++ b/lib/krb5/msg.c
@@ -1,5 +1,5 @@
 /* krb5/msg.c --- Implementation of Kerberos 5 GSS-API Per-Message functions.
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Simon 
Josefsson
  *
  * This file is part of the Generic Security Service (GSS).
  *
@@ -163,7 +163,7 @@ gss_krb5_wrap (OM_uint32 * minor_status,
        data.value = p;
 
        rc = gss_encapsulate_token (&data, GSS_KRB5, output_message_buffer);
-       if (!rc)
+       if (rc != GSS_S_COMPLETE)
          return GSS_S_FAILURE;
        if (k5->acceptor)
          k5->acceptseqnr++;
@@ -249,7 +249,7 @@ gss_krb5_wrap (OM_uint32 * minor_status,
        data.value = p;
 
        rc = gss_encapsulate_token (&data, GSS_KRB5, output_message_buffer);
-       if (!rc)
+       if (rc != GSS_S_COMPLETE)
          return GSS_S_FAILURE;
        if (k5->acceptor)
          k5->acceptseqnr++;
@@ -273,28 +273,29 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
                 int *conf_state, gss_qop_t * qop_state)
 {
   _gss_krb5_ctx_t k5 = context_handle->krb5;
+  gss_buffer_desc tok;
   char *data;
-  size_t datalen;
   OM_uint32 sgn_alg, seal_alg;
   size_t tmplen;
   int rc;
 
-  rc = gss_decapsulate_token (input_message_buffer, GSS_KRB5,
-                             &data, &datalen);
-  if (!rc)
+  rc = gss_decapsulate_token (input_message_buffer, GSS_KRB5, &tok);
+  if (rc != GSS_S_COMPLETE)
     return GSS_S_BAD_MIC;
 
-  if (datalen < 8)
+  if (tok.length < 8)
     return GSS_S_BAD_MIC;
 
-  if (memcmp (data, TOK_WRAP, TOK_LEN) != 0)
+  if (memcmp (tok.value, TOK_WRAP, TOK_LEN) != 0)
     return GSS_S_BAD_MIC;
 
-  sgn_alg = ((char *) data)[2] & 0xFF;
-  sgn_alg |= ((char *) data)[3] << 8 & 0xFF00;
+  data = tok.value;
 
-  seal_alg = ((char *) data)[4] & 0xFF;
-  seal_alg |= ((char *) data)[5] << 8 & 0xFF00;
+  sgn_alg = data[2] & 0xFF;
+  sgn_alg |= data[3] << 8 & 0xFF00;
+
+  seal_alg = data[4] & 0xFF;
+  seal_alg |= data[5] << 8 & 0xFF00;
 
   if (conf_state != NULL)
     *conf_state = seal_alg == 0xFFFF;
@@ -329,7 +330,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
           ;;   PADDED DATA
         */
 
-       if (datalen < 5 * 8)
+       if (tok.length < 5 * 8)
          return GSS_S_BAD_MIC;
 
        memcpy (header, data, 8);
@@ -365,11 +366,11 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
          k5->acceptseqnr++;
 
        /* Check pad */
-       padlen = ((char *) data)[datalen - 1];
+       padlen = data[tok.length - 1];
        if (padlen > 8)
          return GSS_S_BAD_MIC;
        for (i = 1; i <= padlen; i++)
-         if (((char *) data)[datalen - i] != (int)padlen)
+         if (data[tok.length - i] != (int)padlen)
            return GSS_S_BAD_MIC;
 
        /* Write header and confounder next to data */
@@ -380,7 +381,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
        rc = shishi_checksum (k5->sh,
                              k5->key,
                              0, SHISHI_RSA_MD5_DES_GSS,
-                             data + 16, datalen - 16, &tmp, &tmplen);
+                             data + 16, tok.length - 16, &tmp, &tmplen);
        if (rc != SHISHI_OK || tmplen != 8)
          return GSS_S_FAILURE;
 
@@ -391,7 +392,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
          return GSS_S_BAD_MIC;
 
        /* Copy output data */
-       output_message_buffer->length = datalen - 8 - 8 - 8 - 8 - padlen;
+       output_message_buffer->length = tok.length - 8 - 8 - 8 - 8 - padlen;
        output_message_buffer->value = malloc (output_message_buffer->length);
        if (!output_message_buffer->value)
          {
@@ -400,7 +401,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
            return GSS_S_FAILURE;
          }
 
-       memcpy (output_message_buffer->value, pt, datalen - 4 * 8 - padlen);
+       memcpy (output_message_buffer->value, pt, tok.length - 4 * 8 - padlen);
       }
       break;
 
@@ -413,7 +414,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
        size_t outlen, i;
        uint32_t seqnr;
 
-       if (datalen < 8 + 8 + 20 + 8 + 8)
+       if (tok.length < 8 + 8 + 20 + 8 + 8)
          return GSS_S_BAD_MIC;
 
        memcpy (cksum, data + 8 + 8, 20);
@@ -444,11 +445,11 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
          k5->acceptseqnr++;
 
        /* Check pad */
-       padlen = ((char *) data)[datalen - 1];
+       padlen = data[tok.length - 1];
        if (padlen > 8)
          return GSS_S_BAD_MIC;
        for (i = 1; i <= padlen; i++)
-         if (((char *) data)[datalen - i] != (int) padlen)
+         if (data[tok.length - i] != (int) padlen)
            return GSS_S_BAD_MIC;
 
        /* Write header next to confounder */
@@ -459,7 +460,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
                              k5->key,
                              SHISHI_KEYUSAGE_GSS_R2,
                              SHISHI_HMAC_SHA1_DES3_KD, data + 20 + 8,
-                             datalen - 20 - 8, &t, &tmplen);
+                             tok.length - 20 - 8, &t, &tmplen);
        if (rc != SHISHI_OK || tmplen != 20)
          return GSS_S_FAILURE;
 
@@ -471,7 +472,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
          return GSS_S_BAD_MIC;
 
        /* Copy output data */
-       output_message_buffer->length = datalen - 8 - 20 - 8 - 8 - padlen;
+       output_message_buffer->length = tok.length - 8 - 20 - 8 - 8 - padlen;
        output_message_buffer->value = malloc (output_message_buffer->length);
        if (!output_message_buffer->value)
          {
@@ -480,7 +481,7 @@ gss_krb5_unwrap (OM_uint32 * minor_status,
            return GSS_S_FAILURE;
          }
        memcpy (output_message_buffer->value, data + 20 + 8 + 8 + 8,
-               datalen - 20 - 8 - 8 - 8 - padlen);
+               tok.length - 20 - 8 - 8 - 8 - padlen);
       }
       break;
 
diff --git a/lib/libgss.map b/lib/libgss.map
index b78ffb7..b1f8f55 100644
--- a/lib/libgss.map
+++ b/lib/libgss.map
@@ -17,10 +17,10 @@
 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-GSS_0.1.0 {
+GSS_1.0.0 {
   global:
 
-# Standard interfaces:
+# Standard interfaces RFC 2744:
     GSS_C_NT_ANONYMOUS;
     GSS_C_NT_EXPORT_NAME;
     GSS_C_NT_HOSTBASED_SERVICE;
@@ -67,7 +67,11 @@ GSS_0.1.0 {
     gss_wrap;
     gss_wrap_size_limit;
 
-# Extensions:
+# SASL GS2 interfaces RFC 5801:
+    gss_inquire_mech_for_saslname;
+    gss_inquire_saslname_for_mech;
+
+# GNU GSS extensions:
     GSS_C_NT_ANONYMOUS_static;
     GSS_C_NT_EXPORT_NAME_static;
     GSS_C_NT_HOSTBASED_SERVICE_X_static;
@@ -76,36 +80,26 @@ GSS_0.1.0 {
     GSS_C_NT_STRING_UID_NAME_static;
     GSS_C_NT_USER_NAME_static;
     gss_check_version;
-    gss_copy_oid;
     gss_decapsulate_token;
-    gss_duplicate_oid;
     gss_encapsulate_token;
-    gss_encapsulate_token_prefix;
     gss_oid_equal;
     gss_userok;
 
 # Kerberos V5 standard interface:
-    GSS_KRB5_NT_USER_NAME;
     GSS_KRB5_NT_HOSTBASED_SERVICE_NAME;
-    GSS_KRB5_NT_PRINCIPAL_NAME;
     GSS_KRB5_NT_MACHINE_UID_NAME;
+    GSS_KRB5_NT_PRINCIPAL_NAME;
     GSS_KRB5_NT_STRING_UID_NAME;
+    GSS_KRB5_NT_USER_NAME;
 
-# Kerberos V5 extension:
+# GNU GSS Kerberos V5 extensions:
     GSS_KRB5;
-    GSS_KRB5_static;
-    GSS_KRB5_NT_USER_NAME_static;
-    GSS_KRB5_NT_PRINCIPAL_NAME_static;
     GSS_KRB5_NT_MACHINE_UID_NAME_static;
+    GSS_KRB5_NT_PRINCIPAL_NAME_static;
     GSS_KRB5_NT_STRING_UID_NAME_static;
+    GSS_KRB5_NT_USER_NAME_static;
+    GSS_KRB5_static;
 
   local:
     *;
 };
-
-GSS_0.1.4 {
-  global:
-# SASL GS2 interfaces:
-    gss_inquire_mech_for_saslname;
-    gss_inquire_saslname_for_mech;
-} GSS_0.1.0;
diff --git a/lib/meta.c b/lib/meta.c
index a01833b..f836776 100644
--- a/lib/meta.c
+++ b/lib/meta.c
@@ -28,11 +28,6 @@
 # include "krb5/protos.h"
 #endif
 
-/* Get i18n. */
-#include <gettext.h>
-#define gettext_noop(String) String
-#define N_(String) gettext_noop (String)
-
 static _gss_mech_api_desc _gss_mech_apis[] =
   {
 #ifdef USE_KERBEROS5
diff --git a/lib/misc.c b/lib/misc.c
index 4c1d792..77980ed 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -62,6 +62,51 @@ gss_create_empty_oid_set (OM_uint32 * minor_status, 
gss_OID_set * oid_set)
   return GSS_S_COMPLETE;
 }
 
+/*
+ * gss_copy_oid:
+ * @minor_status: (integer, modify) Mechanism specific status code.
+ * @src_oid: (Object ID, read) The object identifier to copy.
+ * @dest_oid: (Object ID, modify) The resultant copy of @src_oid.
+ *   Storage associated with this name must be freed by the
+ *   application, but gss_release_oid() cannot be used generally as it
+ *   deallocate the oid structure itself too.
+ *
+ * Make an exact copy of the given OID, that shares no memory areas
+ * with the original.
+ *
+ * WARNING: This function is a GNU GSS specific extension, and is not
+ * part of the official GSS API.
+ *
+ * Return value:
+ *
+ * `GSS_S_COMPLETE`: Successful completion.
+ **/
+static OM_uint32
+_gss_copy_oid (OM_uint32 * minor_status,
+              const gss_OID src_oid, gss_OID dest_oid)
+{
+  if (minor_status)
+    *minor_status = 0;
+
+  if (!src_oid)
+    return GSS_S_FAILURE | GSS_S_CALL_INACCESSIBLE_READ;
+
+  if (src_oid->length == 0 || src_oid->elements == NULL)
+    return GSS_S_FAILURE | GSS_S_CALL_BAD_STRUCTURE;
+
+  dest_oid->length = src_oid->length;
+  dest_oid->elements = malloc (src_oid->length);
+  if (!dest_oid->elements)
+    {
+      if (minor_status)
+       *minor_status = ENOMEM;
+      return GSS_S_FAILURE;
+    }
+  memcpy (dest_oid->elements, src_oid->elements, src_oid->length);
+
+  return GSS_S_COMPLETE;
+}
+
 /**
  * gss_add_oid_set_member:
  * @minor_status: (integer, modify) Mechanism specific status code.
@@ -136,8 +181,8 @@ gss_add_oid_set_member (OM_uint32 * minor_status,
     (*oid_set)->elements = tmp;
   }
 
-  major_stat = gss_copy_oid (minor_status, member_oid,
-                            (*oid_set)->elements + ((*oid_set)->count - 1));
+  major_stat = _gss_copy_oid (minor_status, member_oid,
+                             (*oid_set)->elements + ((*oid_set)->count - 1));
   if (GSS_ERROR (major_stat))
     return major_stat;
 
diff --git a/lib/saslname.c b/lib/saslname.c
index 9f152ff..9a46846 100644
--- a/lib/saslname.c
+++ b/lib/saslname.c
@@ -22,10 +22,6 @@
 
 #include "internal.h"
 
-/* Get i18n. */
-#include <gettext.h>
-#define _(String) dgettext (PACKAGE, String)
-
 /* _gss_find_mech* */
 #include "meta.h"
 
@@ -79,8 +75,6 @@ dup_data (OM_uint32 *minor_status,
  * `GSS_S_COMPLETE`: Successful completion.
  *
  * `GSS_S_BAD_MECH`: The @desired_mech OID is unsupported.
- *
- * Since: 0.1.4
  **/
 OM_uint32
 gss_inquire_saslname_for_mech (OM_uint32 *minor_status,
@@ -148,8 +142,6 @@ gss_inquire_saslname_for_mech (OM_uint32 *minor_status,
  * `GSS_S_COMPLETE`: Successful completion.
  *
  * `GSS_S_BAD_MECH`: There is no GSS-API mechanism known as @sasl_mech_name.
- *
- * Since: 0.1.4
  **/
 OM_uint32
 gss_inquire_mech_for_saslname (OM_uint32 *minor_status,
diff --git a/tests/krb5context.c b/tests/krb5context.c
index 87ea506..4617bbd 100644
--- a/tests/krb5context.c
+++ b/tests/krb5context.c
@@ -321,6 +321,39 @@ main (int argc, char *argv[])
          display_status ("init_sec_context", maj_stat, min_stat);
        }
 
+      {
+       gss_buffer_desc pt, pt2, ct;
+       int conf_state;
+       gss_qop_t qop_state;
+
+       pt.value = (char *) "foo";
+       pt.length = strlen (pt.value) + 1;
+       maj_stat = gss_wrap (&min_stat,
+                            cctx,
+                            0, 0, &pt, &conf_state, &ct);
+       if (GSS_ERROR (maj_stat))
+         {
+           fail ("client gss_wrap failure\n");
+           display_status ("client wrap", maj_stat, min_stat);
+         }
+
+       maj_stat = gss_unwrap (&min_stat, sctx,
+                              &ct, &pt2, &conf_state, &qop_state);
+       if (GSS_ERROR (maj_stat))
+         {
+           fail ("server gss_unwrap failure\n");
+           display_status ("client wrap", maj_stat, min_stat);
+         }
+
+       if (pt.length != pt2.length
+           || memcmp (pt2.value, pt.value, pt.length) != 0)
+         fail ("wrap+unwrap failed (%d, %d, %.*s)\n",
+               pt.length, pt2.length, pt2.length, (char *) pt2.value);
+
+       gss_release_buffer (&min_stat, &ct);
+       gss_release_buffer (&min_stat, &pt2);
+      }
+
       maj_stat = gss_delete_sec_context (&min_stat, &cctx, GSS_C_NO_BUFFER);
       if (GSS_ERROR (maj_stat))
        {


hooks/post-receive
-- 
GNU gss




reply via email to

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