aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha1.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-08-16 11:06:00 (GMT)
committerJouni Malinen <j@w1.fi>2009-08-16 11:06:00 (GMT)
commit0a5d68aba50c385e316a30d834d5b6174a4041d2 (patch)
treeef28fcecb0dbcacf5d430c4ac187ea6174c876aa /src/crypto/sha1.h
parente1ffdfc18be9027b5ff9ae254f92b6255930ac71 (diff)
downloadhostap-0a5d68aba50c385e316a30d834d5b6174a4041d2.zip
hostap-0a5d68aba50c385e316a30d834d5b6174a4041d2.tar.gz
hostap-0a5d68aba50c385e316a30d834d5b6174a4041d2.tar.bz2
Make hash functions return error value
Some crypto libraries can return in these functions (e.g., if a specific hash function is disabled), so we better provide the caller a chance to check whether the call failed. The return values are not yet used anywhere, but they will be needed for future changes.
Diffstat (limited to 'src/crypto/sha1.h')
-rw-r--r--src/crypto/sha1.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h
index b1dc647..c1a6233 100644
--- a/src/crypto/sha1.h
+++ b/src/crypto/sha1.h
@@ -1,6 +1,6 @@
/*
* SHA1 hash implementation and interface functions
- * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -17,17 +17,17 @@
#define SHA1_MAC_LEN 20
-void hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem,
- const u8 *addr[], const size_t *len, u8 *mac);
-void hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
+int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem,
+ const u8 *addr[], const size_t *len, u8 *mac);
+int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
u8 *mac);
-void sha1_prf(const u8 *key, size_t key_len, const char *label,
- const u8 *data, size_t data_len, u8 *buf, size_t buf_len);
-void sha1_t_prf(const u8 *key, size_t key_len, const char *label,
- const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len);
+int sha1_prf(const u8 *key, size_t key_len, const char *label,
+ const u8 *data, size_t data_len, u8 *buf, size_t buf_len);
+int sha1_t_prf(const u8 *key, size_t key_len, const char *label,
+ const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len);
int __must_check tls_prf(const u8 *secret, size_t secret_len,
const char *label, const u8 *seed, size_t seed_len,
u8 *out, size_t outlen);
-void pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len,
- int iterations, u8 *buf, size_t buflen);
+int pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len,
+ int iterations, u8 *buf, size_t buflen);
#endif /* SHA1_H */