Fixed KE Start Payload parsing to check for mandatory fields.
[crypto.git] / lib / silccrypt / silchmac.c
index 1cce72cd2d4d3e175ba69c308abc4db812f4bac9..d2c50121c8d42632d8e3922d8fd286b022ac830d 100644 (file)
@@ -185,7 +185,7 @@ bool silc_hmac_unregister_all(void)
    of the HMAC.  If it is NULL then the hash function is allocated and
    the name of the hash algorithm is derived from the `name'. */
 
-bool silc_hmac_alloc(char *name, SilcHash hash, SilcHmac *new_hmac)
+bool silc_hmac_alloc(const char *name, SilcHash hash, SilcHmac *new_hmac)
 {
   SILC_LOG_DEBUG(("Allocating new HMAC"));
 
@@ -429,7 +429,7 @@ void silc_hmac_init_with_key(SilcHmac hmac, const unsigned char *key,
                             SilcUInt32 key_len)
 {
   SilcHash hash = hmac->hash;
-  silc_hmac_init_internal(hmac, hmac->key, hmac->key_len);
+  silc_hmac_init_internal(hmac, (unsigned char *)key, key_len);
   silc_hash_init(hash);
   silc_hash_update(hash, hmac->inner_pad, silc_hash_block_len(hash));
 }