summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-20 08:59:49 +0100
committerStef Walter <stefw@gnome.org>2013-03-20 09:31:50 +0100
commit1dc227b4fce16fcc721276925492f4ba4db00b4f (patch)
tree1a0b070061e27e967c07208f2f21891c29969986 /tools
parentef8c54a355d3f9814cc53a0aad72d61247b169a0 (diff)
hash: Rename file and functions for hashes
We're going to be adding other hashes. Also build as part of a different common library.
Diffstat (limited to 'tools')
-rw-r--r--tools/extract-jks.c14
-rw-r--r--tools/extract-openssl.c10
2 files changed, 12 insertions, 12 deletions
diff --git a/tools/extract-jks.c b/tools/extract-jks.c
index d75735c..d72b1dc 100644
--- a/tools/extract-jks.c
+++ b/tools/extract-jks.c
@@ -36,10 +36,10 @@
#include "attrs.h"
#include "buffer.h"
-#include "checksum.h"
#include "compat.h"
#include "debug.h"
#include "extract.h"
+#include "hash.h"
#include "library.h"
#include "save.h"
@@ -299,13 +299,13 @@ prepare_jks_buffer (P11KitIter *iter,
* as the password for this keyed digest.
*/
length = buffer->len;
- digest = p11_buffer_append (buffer, P11_CHECKSUM_SHA1_LENGTH);
+ digest = p11_buffer_append (buffer, P11_HASH_SHA1_LEN);
return_val_if_fail (digest != NULL, false);
- p11_checksum_sha1 (digest,
- "\000c\000h\000a\000n\000g\000e\000i\000t", 16, /* default password */
- "Mighty Aphrodite", 16, /* go figure */
- buffer->data, length,
- NULL);
+ p11_hash_sha1 (digest,
+ "\000c\000h\000a\000n\000g\000e\000i\000t", 16, /* default password */
+ "Mighty Aphrodite", 16, /* go figure */
+ buffer->data, length,
+ NULL);
return_val_if_fail (p11_buffer_ok (buffer), false);
return true;
diff --git a/tools/extract-openssl.c b/tools/extract-openssl.c
index bc7427a..8e02421 100644
--- a/tools/extract-openssl.c
+++ b/tools/extract-openssl.c
@@ -37,11 +37,11 @@
#include "asn1.h"
#include "attrs.h"
#include "buffer.h"
-#include "checksum.h"
#include "compat.h"
#include "debug.h"
#include "dict.h"
#include "extract.h"
+#include "hash.h"
#include "library.h"
#include "oid.h"
#include "pem.h"
@@ -520,7 +520,7 @@ p11_openssl_canon_name_der (p11_dict *asn1_defs,
static char *
symlink_for_subject_hash (p11_extract_info *ex)
{
- unsigned char md[P11_CHECKSUM_SHA1_LENGTH];
+ unsigned char md[P11_HASH_SHA1_LEN];
p11_buffer der;
CK_ATTRIBUTE *subject;
unsigned long hash;
@@ -535,7 +535,7 @@ symlink_for_subject_hash (p11_extract_info *ex)
return_val_if_fail (der.data != NULL, NULL);
if (p11_openssl_canon_name_der (ex->asn1_defs, &der)) {
- p11_checksum_sha1 (md, der.data, der.len, NULL);
+ p11_hash_sha1 (md, der.data, der.len, NULL);
hash = (
((unsigned long)md[0] ) | ((unsigned long)md[1] << 8L) |
@@ -553,7 +553,7 @@ symlink_for_subject_hash (p11_extract_info *ex)
static char *
symlink_for_subject_old_hash (p11_extract_info *ex)
{
- unsigned char md[P11_CHECKSUM_MD5_LENGTH];
+ unsigned char md[P11_HASH_MD5_LEN];
CK_ATTRIBUTE *subject;
unsigned long hash;
char *linkname;
@@ -562,7 +562,7 @@ symlink_for_subject_old_hash (p11_extract_info *ex)
if (!subject)
return NULL;
- p11_checksum_md5 (md, subject->pValue, subject->ulValueLen, NULL);
+ p11_hash_md5 (md, subject->pValue, subject->ulValueLen, NULL);
hash = (
((unsigned long)md[0] ) | ((unsigned long)md[1] << 8L) |