Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
*/
-/*
- * $Id$
- * $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
- *
- *
- */
+/* $Id$ */
#include "silcincludes.h"
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;
(*new_hmac)->make_hmac_with_key = silc_hmac_make_with_key;
(*new_hmac)->make_hmac_truncated = silc_hmac_make_truncated;
- return 1;
+ return TRUE;
}
/* Free's the SilcHmac object. */
unsigned int key_len)
{
hmac->key = silc_calloc(key_len, sizeof(unsigned char));
+ hmac->key_len = key_len;
memcpy(hmac->key, key, key_len);
}