Moved silc_client_ch[u]mode[_char] to client library from silc/.
[silc.git] / lib / silccrypt / silchmac.c
index ddf7453b544b247b0af0b34d80ea2d1aba583481..30f36c3f98a8cbc5593f80a9fca2151af9494a0b 100644 (file)
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2000/06/27 11:36:55  priikone
- * Initial revision
+ * Revision 1.3  2000/07/14 09:12:24  priikone
+ *     Fixed bug in silc_hmac_make.
+ *
+ * Revision 1.2  2000/07/05 06:08:43  priikone
+ *     Global cosmetic change.
+ *
+ * Revision 1.1.1.1  2000/06/27 11:36:55  priikone
+ *     Imported from internal CVS/Added Log headers.
  *
  *
  */
@@ -37,11 +43,6 @@ int silc_hmac_alloc(SilcHash hash, SilcHmac *new_hmac)
   SILC_LOG_DEBUG(("Allocating new hmac object"));
 
   *new_hmac = silc_calloc(1, sizeof(**new_hmac));
-  if (*new_hmac == NULL) {
-    SILC_LOG_ERROR(("Could not allocate new hmac object"));
-    return 0;
-  }
-
   (*new_hmac)->hash = hash;
   (*new_hmac)->set_key = silc_hmac_set_key;
   (*new_hmac)->make_hmac = silc_hmac_make;
@@ -154,5 +155,6 @@ void silc_hmac_set_key(SilcHmac hmac, const unsigned char *key,
                       unsigned int key_len)
 {
   hmac->key = silc_calloc(key_len, sizeof(unsigned char));
+  hmac->key_len = key_len;
   memcpy(hmac->key, key, key_len);
 }