shishi-commit
[Top][All Lists]
Advanced

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

shishi ./NEWS doc/shishi.texi lib/crypto.c


From: shishi-commit
Subject: shishi ./NEWS doc/shishi.texi lib/crypto.c
Date: Sun, 21 Sep 2003 09:30:38 -0400

CVSROOT:        /cvsroot/shishi
Module name:    shishi
Branch:         
Changes by:     Simon Josefsson <address@hidden>        03/09/21 09:30:38

Modified files:
        .              : NEWS 
        doc            : shishi.texi 
        lib            : crypto.c 

Log message:
        Support encryption type name aliases.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/NEWS.diff?tr1=1.56&tr2=1.57&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/doc/shishi.texi.diff?tr1=1.83&tr2=1.84&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto.c.diff?tr1=1.89&tr2=1.90&r1=text&r2=text

Patches:
Index: shishi/NEWS
diff -u shishi/NEWS:1.56 shishi/NEWS:1.57
--- shishi/NEWS:1.56    Fri Sep 19 20:06:38 2003
+++ shishi/NEWS Sun Sep 21 09:30:38 2003
@@ -4,6 +4,9 @@
 
 * Version 0.0.7 (unreleased)
 
+** Encryption types can now be referred to using shorter aliases.
+E.g., you can write "aes" instead of "aes256-cts-hmac-sha1-96".
+
 ** ARCFOUR encryption support according to draft-brezak-win2k-krb-rc4-hmac-04.
 
 ** DES-CBC-CRC now works.
Index: shishi/doc/shishi.texi
diff -u shishi/doc/shishi.texi:1.83 shishi/doc/shishi.texi:1.84
--- shishi/doc/shishi.texi:1.83 Fri Sep 19 19:49:59 2003
+++ shishi/doc/shishi.texi      Sun Sep 21 09:30:38 2003
@@ -361,7 +361,7 @@
 weak.  It is associated with the @code{NULL} checksum.
 
 @item arcfour-hmac
address@hidden arcfour-hmac-exp
address@hidden arcfour-hmac-exp
 
 @code{arcfour-hmac-*} are a proprietary stream cipher with 56 bit
 (@code{arcfour-hmac-exp}) or 128 bit (@code{arcfour-hmac}) keys, used
@@ -418,7 +418,7 @@
 is associated with the @code{hmac-sha1-des3-kd} checksum.
 
 @item aes128-cts-hmac-sha1-96
address@hidden aes256-cts-hmac-sha1-96.
address@hidden aes256-cts-hmac-sha1-96
 
 @code{aes128-cts-hmac-sha1-96} and @code{aes256-cts-hmac-sha1-96} is
 AES encryption and decryption with 128 bit and 256 bit key,
@@ -511,7 +511,7 @@
 encryption mechanism.
 
 @item hmac-sha1-96-aes128
address@hidden hmac-sha1-96-aes256
address@hidden hmac-sha1-96-aes256
 
 @code{hmac-sha1-96-aes*} are keyed SHA1 hashes in HMAC mode computed
 over the message and then truncated to 96 bits.  The key is derived
@@ -524,6 +524,44 @@
 
 @end table
 
+Several of the cipher suites have long names that can be hard to
+memorize.  For your convenience, the following short-hand aliases
+exists.
+
address@hidden @code
+
address@hidden arcfour
+
+Alias for @code{arcfour-hmac}.
+
address@hidden des-crc
+
+Alias for @code{des-cbc-crc}.
+
address@hidden des-md4
+
+Alias for @code{des-cbc-md4}.
+
address@hidden des-md5
address@hidden des
+
+Alias for @code{des-cbc-md5}.
+
address@hidden des3
address@hidden 3des
+
+Alias for @code{des3-cbc-sha1-kd}.
+
address@hidden aes128
+
+Alias for @code{aes128-cts-hmac-sha1-96}.
+
address@hidden aes
address@hidden aes256
+
+Alias for @code{aes256-cts-hmac-sha1-96}.
+
address@hidden table
 
 @node Supported Platforms
 @section Supported Platforms
Index: shishi/lib/crypto.c
diff -u shishi/lib/crypto.c:1.89 shishi/lib/crypto.c:1.90
--- shishi/lib/crypto.c:1.89    Sat Sep 20 07:06:10 2003
+++ shishi/lib/crypto.c Sun Sep 21 09:30:38 2003
@@ -257,7 +257,7 @@
       memset (pt + inlen, 0, padzerolen);
     }
   else
-    pt = in;
+    pt = (char*) in;
 
   switch (shishi_key_type (key))
     {
@@ -660,6 +660,22 @@
   return -1;
 }
 
+static struct {
+  char *name;
+  int type;
+} cipher_aliases[] = {
+  { "des-crc", SHISHI_DES_CBC_CRC },
+  { "des-md4", SHISHI_DES_CBC_MD4 },
+  { "des-md5", SHISHI_DES_CBC_MD5 },
+  { "des", SHISHI_DES_CBC_MD5 },
+  { "des3", SHISHI_DES3_CBC_HMAC_SHA1_KD },
+  { "3des", SHISHI_DES3_CBC_HMAC_SHA1_KD },
+  { "aes128", SHISHI_AES128_CTS_HMAC_SHA1_96 },
+  { "aes256", SHISHI_AES256_CTS_HMAC_SHA1_96 },
+  { "aes", SHISHI_AES256_CTS_HMAC_SHA1_96 },
+  { "arcfour", SHISHI_ARCFOUR_HMAC }
+};
+
 /**
  * shishi_cipher_parse:
  * @cipher: name of encryption type, e.g. "des3-cbc-sha1-kd".
@@ -680,6 +696,10 @@
   for (i = 0; i < sizeof (ciphers) / sizeof (ciphers[0]); i++)
     if (strcasecmp (cipher, ciphers[i]->name) == 0)
       return ciphers[i]->type;
+
+  for (i = 0; i < sizeof (cipher_aliases) / sizeof (cipher_aliases[0]); i++)
+    if (strcasecmp (cipher, cipher_aliases[i].name) == 0)
+      return cipher_aliases[i].type;
 
   return -1;
 }




reply via email to

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