shishi-commit
[Top][All Lists]
Advanced

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

[SCM] GNU shishi branch, master, updated. shishi-1-0-1-19-g2d20861


From: Simon Josefsson
Subject: [SCM] GNU shishi branch, master, updated. shishi-1-0-1-19-g2d20861
Date: Wed, 15 Aug 2012 19:36:49 +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 shishi".

http://git.savannah.gnu.org/cgit/shishi.git/commit/?id=2d208614a4522bc7b3dca740266ec15c6e54372f

The branch, master has been updated
       via  2d208614a4522bc7b3dca740266ec15c6e54372f (commit)
       via  fad6913c8f92b290edd33bd7b269e5b3245dbf6f (commit)
       via  523c476dd6ed60099af041ca60df0582aa3ae30b (commit)
      from  474f6829a5be650bc6f687a436e7b86537007c95 (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 2d208614a4522bc7b3dca740266ec15c6e54372f
Author: Simon Josefsson <address@hidden>
Date:   Wed Aug 15 21:36:35 2012 +0200

    Fix encticketpart cname encoding bug, reported by Mats.

commit fad6913c8f92b290edd33bd7b269e5b3245dbf6f
Author: Simon Josefsson <address@hidden>
Date:   Wed Aug 15 21:35:34 2012 +0200

    Check regression for encticketpart cname encoding bug.

commit 523c476dd6ed60099af041ca60df0582aa3ae30b
Author: Simon Josefsson <address@hidden>
Date:   Wed Aug 15 21:27:10 2012 +0200

    Doc fix.

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

Summary of changes:
 lib/encticketpart.c |   18 ++---------
 lib/kdcrep.c        |    2 +-
 tests/Makefile.am   |    2 +-
 tests/multiname.c   |   79 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 84 insertions(+), 17 deletions(-)
 create mode 100644 tests/multiname.c

diff --git a/lib/encticketpart.c b/lib/encticketpart.c
index 94da535..4f7dc8e 100644
--- a/lib/encticketpart.c
+++ b/lib/encticketpart.c
@@ -212,24 +212,12 @@ shishi_encticketpart_cname_set (Shishi * handle,
 {
   int res;
 
-  res = shishi_asn1_write_uint32 (handle, encticketpart,
-                                 "cname.name-type", name_type);
+  res = shishi_principal_set (handle, encticketpart, "cname", principal);
   if (res != SHISHI_OK)
     return res;
 
-  res = shishi_asn1_write (handle, encticketpart,
-                          "cname.name-string", NULL, 0);
-  if (res != SHISHI_OK)
-    return res;
-
-  res = shishi_asn1_write (handle, encticketpart,
-                          "cname.name-string", "NEW", 1);
-  if (res != SHISHI_OK)
-    return res;
-
-  res = shishi_asn1_write (handle, encticketpart,
-                          "cname.name-string.?1",
-                          principal, strlen (principal));
+  res = shishi_asn1_write_uint32 (handle, encticketpart,
+                                 "cname.name-type", name_type);
   if (res != SHISHI_OK)
     return res;
 
diff --git a/lib/kdcrep.c b/lib/kdcrep.c
index 75df3b4..1986a2d 100644
--- a/lib/kdcrep.c
+++ b/lib/kdcrep.c
@@ -291,7 +291,7 @@ shishi_kdcrep_crealm_set (Shishi * handle,
  *             SHISHI_NT_UNKNOWN.
  * @cname: input array with principal name.
  *
- * Set the server name field in the KDC-REP.
+ * Set the client name field in the KDC-REP.
  *
  * Return value: Returns SHISHI_OK iff successful.
  **/
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3d34376..a6a5ee1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,7 +32,7 @@ libutils_la_SOURCES = utils.h utils.c
 
 check_PROGRAMS = authenticator crypto gztime priv safe ticketset       \
        crypto-ctx low-crypto rijndael key keytab ccache nonce          \
-       passwdpromptcb
+       passwdpromptcb multiname
 TESTS = $(check_PROGRAMS)
 
 TESTS_ENVIRONMENT = \
diff --git a/tests/multiname.c b/tests/multiname.c
new file mode 100644
index 0000000..2a7a814
--- /dev/null
+++ b/tests/multiname.c
@@ -0,0 +1,79 @@
+/* encticketpart.c --- Shishi encticketpart self tests.
+ * Copyright (C) 2012 Simon Josefsson
+ *
+ * This file is part of Shishi.
+ *
+ * Shishi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Shishi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Shishi; if not, see http://www.gnu.org/licenses or write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+/* Check that principals are encoded properly in encticketpart.
+   http://permalink.gmane.org/gmane.comp.gnu.shishi.general/711
+*/
+
+#include "utils.c"
+
+void
+test (Shishi * handle)
+{
+  Shishi_asn1 encticketpart;
+  char *client;
+  size_t clientlen;
+  uint32_t i;
+  int res;
+
+  encticketpart = shishi_encticketpart (handle);
+  if (encticketpart)
+    success ("shishi_encticketpart() OK\n");
+  else
+    fail ("shishi_encticketpart() failed\n");
+
+  res = shishi_encticketpart_cname_set (handle,
+                                       encticketpart,
+                                       42,
+                                       "foo/bar");
+  if (debug)
+    {
+      res = shishi_encticketpart_print (handle, stdout, encticketpart);
+      if (res == SHISHI_OK)
+       success ("shishi_encticketpart_print() OK\n");
+      else
+       fail ("shishi_encticketpart_print() failed\n");
+    }
+
+  res = shishi_encticketpart_client (handle, encticketpart,
+                                    &client, &clientlen);
+  if (res == SHISHI_OK)
+    success ("shishi_encticketpart_client() OK\n");
+  else
+    fail ("shishi_encticketpart_client() failed\n");
+
+  if (clientlen == strlen ("foo/bar") &&
+      memcmp ("foo/bar", client, clientlen) == 0)
+    success ("encticketpart encoding OK\n");
+  else
+    fail ("encticketpart encoding failed\n");
+
+
+  res = shishi_asn1_read_uint32 (handle, encticketpart,
+                                "cname.name-type", &i);
+  if (res == SHISHI_OK)
+    success ("shishi_asn1_read_uint32() OK\n");
+  else
+    fail ("shishi_asn1_read_uint32() failed\n");
+  if (i != 42)
+    fail ("encticketpart name-type failed (%d)\n", i);
+}


hooks/post-receive
-- 
GNU shishi



reply via email to

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