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-0-0-41-13-g3945081


From: Simon Josefsson
Subject: [SCM] GNU shishi branch, master, updated. shishi-0-0-41-13-g3945081
Date: Wed, 10 Mar 2010 22:06:05 +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=3945081a4bef4597f0885030c32b995d163a2996

The branch, master has been updated
       via  3945081a4bef4597f0885030c32b995d163a2996 (commit)
       via  2233f604b6b91b5f5cc96ded0d03d51dbe903a3d (commit)
       via  3271384504f884f4a8480f9c7eca4753374418a3 (commit)
       via  4db80d056683939f5f3a5ef6f0086dcbecc6addd (commit)
      from  3948ccfbf0bdc05e864d1877a277a12488619c44 (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 3945081a4bef4597f0885030c32b995d163a2996
Author: Simon Josefsson <address@hidden>
Date:   Wed Mar 10 22:37:43 2010 +0100

    (shishi_ap_authenticator_cksumdata): Also check @out.

commit 2233f604b6b91b5f5cc96ded0d03d51dbe903a3d
Author: Simon Josefsson <address@hidden>
Date:   Wed Mar 10 22:34:42 2010 +0100

    (shishi_ap_authenticator_cksumdata): Return requested size.

commit 3271384504f884f4a8480f9c7eca4753374418a3
Author: Simon Josefsson <address@hidden>
Date:   Wed Mar 10 10:38:48 2010 +0100

    Add.

commit 4db80d056683939f5f3a5ef6f0086dcbecc6addd
Author: Simon Josefsson <address@hidden>
Date:   Wed Mar 10 10:38:25 2010 +0100

    libshishi: Fix bug where '3des' is parsed as 'des'.

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

Summary of changes:
 NEWS           |    2 ++
 lib/ap.c       |   12 ++++++++----
 lib/crypto.c   |    2 +-
 tests/crypto.c |    6 +++++-
 4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 4331234..5b77ec2 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ The function is shishi_keys_from_file.
 ** keytab2shishi: Add --reverse (-R) parameter to write Keytab files.
 This allows you to use create Keytab files from your Shishi hostkeys.
 
+** libshishi: Fix bug where '3des' is parsed as 'des'.
+
 ** API and ABI modifications:
 shishi_key_timestamp: ADD.
 shishi_key_timestamp_set: ADD.
diff --git a/lib/ap.c b/lib/ap.c
index bbb354f..1bc608f 100644
--- a/lib/ap.c
+++ b/lib/ap.c
@@ -574,15 +574,19 @@ shishi_ap_tkt_set (Shishi_ap * ap, Shishi_tkt * tkt)
  *
  * Get checksum data from Authenticator.
  *
- * Return value: Returns SHISHI_OK if successful, or
- * SHISHI_TOO_SMALL_BUFFER if buffer provided was too small.
+ * Return value: Returns %SHISHI_OK if successful, or
+ *   %SHISHI_TOO_SMALL_BUFFER if buffer provided was too small (then @len
+ *   will hold necessary buffer size).
  **/
 int
 shishi_ap_authenticator_cksumdata (Shishi_ap * ap, char *out, size_t * len)
 {
   if (*len < ap->authenticatorcksumdatalen)
-    return SHISHI_TOO_SMALL_BUFFER;
-  if (ap->authenticatorcksumdata)
+    {
+      *len = ap->authenticatorcksumdatalen;
+      return SHISHI_TOO_SMALL_BUFFER;
+    }
+  if (out && ap->authenticatorcksumdata)
     memcpy (out, ap->authenticatorcksumdata, ap->authenticatorcksumdatalen);
   *len = ap->authenticatorcksumdatalen;
   return SHISHI_OK;
diff --git a/lib/crypto.c b/lib/crypto.c
index e869534..070cd2f 100644
--- a/lib/crypto.c
+++ b/lib/crypto.c
@@ -697,7 +697,7 @@ shishi_cipher_parse (const char *cipher)
 
   i = strtol (cipher, &endptr, 0);
 
-  if (endptr != cipher)
+  if (*cipher && *endptr == '\0')
     return i;
 
   for (i = 0; i < sizeof (ciphers) / sizeof (ciphers[0]); i++)
diff --git a/tests/crypto.c b/tests/crypto.c
index 8004677..15a35d7 100644
--- a/tests/crypto.c
+++ b/tests/crypto.c
@@ -1,5 +1,5 @@
 /* crypto.c --- Shishi crypto self tests.
- * Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008  Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2010  Simon Josefsson
  *
  * This file is part of Shishi.
  *
@@ -347,6 +347,10 @@ test (Shishi * handle)
   if (debug)
     shishi_cfg (handle, strdup ("verbose-crypto,verbose-crypto-noise"));
 
+  res = shishi_cipher_parse ("3des");
+  if (res != SHISHI_DES3_CBC_HMAC_SHA1_KD)
+    fail ("shishi_cipher_parse (\"3des\") == %d\n", res);
+
   for (i = 0; i < sizeof (drdk) / sizeof (drdk[0]); i++)
     {
       if (debug)


hooks/post-receive
-- 
GNU shishi




reply via email to

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