/*
digest.c -- Digest handling
- Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-2012 Guus Sliepen <guus@tinc-vpn.org>
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
digest->key = NULL;
if(!digest->digest) {
- logger(LOG_DEBUG, "Unknown digest name '%s'!", name);
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "Unknown digest name '%s'!", name);
return false;
}
digest->key = NULL;
if(!digest->digest) {
- logger(LOG_DEBUG, "Unknown digest nid %d!", nid);
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "Unknown digest nid %d!", nid);
return false;
}
}
void digest_close(digest_t *digest) {
- if(digest->key)
- free(digest->key);
+ free(digest->key);
digest->key = NULL;
}
if(!EVP_DigestInit(&ctx, digest->digest)
|| !EVP_DigestUpdate(&ctx, indata, inlen)
|| !EVP_DigestFinal(&ctx, tmpdata, NULL)) {
- logger(LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
}