aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-13 08:28:03 (GMT)
committerJouni Malinen <j@w1.fi>2009-08-13 08:28:03 (GMT)
commit6b5c4c3359b5a2b3d6a0db9febc32b66be21b73a (patch)
treeec91d839d5b4e3831fb0e060d08bf6ee3b107c75
parent27da6d4a0e43b596322c599122a39d70f78b6d73 (diff)
downloadhostap-6b5c4c3359b5a2b3d6a0db9febc32b66be21b73a.zip
hostap-6b5c4c3359b5a2b3d6a0db9febc32b66be21b73a.tar.gz
hostap-6b5c4c3359b5a2b3d6a0db9febc32b66be21b73a.tar.bz2
Remove some more crypto ifdef, fix a few small bugs
-rw-r--r--src/crypto/crypto_internal.c7
-rw-r--r--src/crypto/fips_prf_internal.c3
-rw-r--r--src/crypto/md5-internal.c7
-rw-r--r--src/crypto/md5.h10
-rw-r--r--src/crypto/md5_i.h25
-rw-r--r--src/crypto/sha1-internal.c6
-rw-r--r--src/crypto/sha1.h9
-rw-r--r--src/crypto/sha1_i.h25
8 files changed, 55 insertions, 37 deletions
diff --git a/src/crypto/crypto_internal.c b/src/crypto/crypto_internal.c
index f8d841f..98a1ddc 100644
--- a/src/crypto/crypto_internal.c
+++ b/src/crypto/crypto_internal.c
@@ -24,8 +24,8 @@
#include "tls/bignum.h"
#include "tls/asn1.h"
-
-#ifdef CONFIG_CRYPTO_INTERNAL
+#include "sha1_i.h"
+#include "md5_i.h"
#ifdef CONFIG_TLS_INTERNAL
@@ -831,6 +831,3 @@ error:
}
#endif /* EAP_FAST || EAP_SERVER_FAST || CONFIG_WPS */
-
-
-#endif /* CONFIG_CRYPTO_INTERNAL */
diff --git a/src/crypto/fips_prf_internal.c b/src/crypto/fips_prf_internal.c
index 30acb64..a85cb14 100644
--- a/src/crypto/fips_prf_internal.c
+++ b/src/crypto/fips_prf_internal.c
@@ -16,10 +16,9 @@
#include "common.h"
#include "sha1.h"
+#include "sha1_i.h"
#include "crypto.h"
-void SHA1Transform(u32 state[5], const unsigned char buffer[64]);
-
int fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, size_t xlen)
{
diff --git a/src/crypto/md5-internal.c b/src/crypto/md5-internal.c
index 6651da5..411757b 100644
--- a/src/crypto/md5-internal.c
+++ b/src/crypto/md5-internal.c
@@ -16,6 +16,7 @@
#include "common.h"
#include "md5.h"
+#include "md5_i.h"
#include "crypto.h"
struct MD5Context {
@@ -24,12 +25,6 @@ struct MD5Context {
u8 in[64];
};
-#ifndef CONFIG_CRYPTO_INTERNAL
-static void MD5Init(struct MD5Context *context);
-static void MD5Update(struct MD5Context *context, unsigned char const *buf,
- unsigned len);
-static void MD5Final(unsigned char digest[16], struct MD5Context *context);
-#endif /* CONFIG_CRYPTO_INTERNAL */
static void MD5Transform(u32 buf[4], u32 const in[16]);
diff --git a/src/crypto/md5.h b/src/crypto/md5.h
index e82f396..480a2f4 100644
--- a/src/crypto/md5.h
+++ b/src/crypto/md5.h
@@ -21,14 +21,4 @@ void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem,
const u8 *addr[], const size_t *len, u8 *mac);
void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
u8 *mac);
-
-#ifdef CONFIG_CRYPTO_INTERNAL
-struct MD5Context;
-
-void MD5Init(struct MD5Context *context);
-void MD5Update(struct MD5Context *context, unsigned char const *buf,
- unsigned len);
-void MD5Final(unsigned char digest[16], struct MD5Context *context);
-#endif /* CONFIG_CRYPTO_INTERNAL */
-
#endif /* MD5_H */
diff --git a/src/crypto/md5_i.h b/src/crypto/md5_i.h
new file mode 100644
index 0000000..7697c3f
--- /dev/null
+++ b/src/crypto/md5_i.h
@@ -0,0 +1,25 @@
+/*
+ * MD5 internal definitions
+ * Copyright (c) 2003-2005, 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
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#ifndef MD5_I_H
+#define MD5_I_H
+
+struct MD5Context;
+
+void MD5Init(struct MD5Context *context);
+void MD5Update(struct MD5Context *context, unsigned char const *buf,
+ unsigned len);
+void MD5Final(unsigned char digest[16], struct MD5Context *context);
+
+#endif /* MD5_I_H */
diff --git a/src/crypto/sha1-internal.c b/src/crypto/sha1-internal.c
index f40401c..1f66e92 100644
--- a/src/crypto/sha1-internal.c
+++ b/src/crypto/sha1-internal.c
@@ -16,6 +16,7 @@
#include "common.h"
#include "sha1.h"
+#include "sha1_i.h"
#include "md5.h"
#include "crypto.h"
@@ -27,11 +28,6 @@ struct SHA1Context {
typedef struct SHA1Context SHA1_CTX;
-#ifndef CONFIG_CRYPTO_INTERNAL
-static void SHA1Init(struct SHA1Context *context);
-static void SHA1Update(struct SHA1Context *context, const void *data, u32 len);
-static void SHA1Final(unsigned char digest[20], struct SHA1Context *context);
-#endif /* CONFIG_CRYPTO_INTERNAL */
void SHA1Transform(u32 state[5], const unsigned char buffer[64]);
diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h
index 9c365e2..b1dc647 100644
--- a/src/crypto/sha1.h
+++ b/src/crypto/sha1.h
@@ -30,13 +30,4 @@ int __must_check tls_prf(const u8 *secret, size_t secret_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);
-
-#ifdef CONFIG_CRYPTO_INTERNAL
-struct SHA1Context;
-
-void SHA1Init(struct SHA1Context *context);
-void SHA1Update(struct SHA1Context *context, const void *data, u32 len);
-void SHA1Final(unsigned char digest[20], struct SHA1Context *context);
-#endif /* CONFIG_CRYPTO_INTERNAL */
-
#endif /* SHA1_H */
diff --git a/src/crypto/sha1_i.h b/src/crypto/sha1_i.h
new file mode 100644
index 0000000..e4b3a96
--- /dev/null
+++ b/src/crypto/sha1_i.h
@@ -0,0 +1,25 @@
+/*
+ * SHA1 internal definitions
+ * Copyright (c) 2003-2005, 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
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#ifndef SHA1_I_H
+#define SHA1_I_H
+
+struct SHA1Context;
+
+void SHA1Init(struct SHA1Context *context);
+void SHA1Update(struct SHA1Context *context, const void *data, u32 len);
+void SHA1Final(unsigned char digest[20], struct SHA1Context *context);
+void SHA1Transform(u32 state[5], const unsigned char buffer[64]);
+
+#endif /* SHA1_I_H */