aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2015-03-30 13:16:51 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-03-30 14:01:30 -0700
commit912c6ecf72fb2c84fbf17dbd0666492778dbd9fc (patch)
treec82fafae71f2017e211192fd70bfe3c13712676a /src/eap_common
parentdda10c2afb8378747491ea5d329a1de635d6d58e (diff)
downloadandroid_external_wpa_supplicant_8-912c6ecf72fb2c84fbf17dbd0666492778dbd9fc.tar.gz
android_external_wpa_supplicant_8-912c6ecf72fb2c84fbf17dbd0666492778dbd9fc.tar.bz2
android_external_wpa_supplicant_8-912c6ecf72fb2c84fbf17dbd0666492778dbd9fc.zip
Cumulative patch from commit 989e784601887734e696b3fac0ad6d101badd7ea
989e784 P2P: Optimize scan frequencies list when re-joining a persistent group 154a1d5 hostapd: Fix some compilation errors ce18c10 Add support for CONFIG_NO_ROAMING to Makefile 65a7b21 OpenSSL: Implement AES-128 CBC using EVP API 22ba05c Explicitly clear temporary stack buffers in tls_prf_sha1_md5() 940a4db Explicitly clear temporary stack buffer in sha1_t_prf() eccca10 Explicitly clear temporary stack buffer in hmac_sha256_kdf() e8e365d wext: Add support for renamed Host AP driver ifname fc48d33 Improve error messages related to EAP DB c469d62 Error out if user configures SQLite DB without CONFIG_SQLITE 270427e HS 2.0R2: Add more logging for hs20-osu-client icon matching 8e31cd2 OSU server: Improve logging for SPP schema validation failures 23dd15a http-curl: Improve log messages e7d285c OSU server: Print out signup ID if there is some problem with it 1b45006 HS 2.0R2: Remove unused argument identifier from hs20-osu-client 2e7a228 HS 2.0R2: Allow custom libcurl linkage for hs20-osu-client a52410c Allow PSK/passphrase to be set only when needed 3e808b8 EAP-pwd peer: Add support for hashed password e4840b3 EAP-pwd server: Add support for hashed password 2bd2ed2 EAP-pwd: Mark helper function arguments const when appropriate 9ccc10f wpa_cli: Use tab as only word separator for networks 5a997b2 wpa_cli: Completion routine for dup_network command 1ca6c0f wpa_cli: Completion for remove, select, disable, enable network 7e6cc90 wpa_cli: Implement completion routine for get_network/set_network 32a097f wpa_cli: Keep track of available networks 94dc0e9 wpa_cli: Allow tab as alternative separator for cli_txt_list words efa232f Add support for virtual interface creation/deletion ba87329 wpa_cli: Use .wpa_cli_history under Android 0f8385e Show OSEN key management properly in scan results e7b4cd0 wpa_gui: Add tray icon based signal strength meter 54d3dc9 AP: Unset HT capabilities for an HT association request without WMM Change-Id: I71425b8e20fe1dfdb777592257dc4e4063da8d85 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_pwd_common.c17
-rw-r--r--src/eap_common/eap_pwd_common.h13
2 files changed, 18 insertions, 12 deletions
diff --git a/src/eap_common/eap_pwd_common.c b/src/eap_common/eap_pwd_common.c
index 631c363f..4d27623f 100644
--- a/src/eap_common/eap_pwd_common.c
+++ b/src/eap_common/eap_pwd_common.c
@@ -86,9 +86,10 @@ static int eap_pwd_kdf(const u8 *key, size_t keylen, const u8 *label,
* on the password and identities.
*/
int compute_password_element(EAP_PWD_group *grp, u16 num,
- u8 *password, int password_len,
- u8 *id_server, int id_server_len,
- u8 *id_peer, int id_peer_len, u8 *token)
+ const u8 *password, size_t password_len,
+ const u8 *id_server, size_t id_server_len,
+ const u8 *id_peer, size_t id_peer_len,
+ const u8 *token)
{
BIGNUM *x_candidate = NULL, *rnd = NULL, *cofactor = NULL;
struct crypto_hash *hash;
@@ -283,10 +284,10 @@ int compute_password_element(EAP_PWD_group *grp, u16 num,
}
-int compute_keys(EAP_PWD_group *grp, BN_CTX *bnctx, BIGNUM *k,
- BIGNUM *peer_scalar, BIGNUM *server_scalar,
- u8 *confirm_peer, u8 *confirm_server,
- u32 *ciphersuite, u8 *msk, u8 *emsk, u8 *session_id)
+int compute_keys(EAP_PWD_group *grp, BN_CTX *bnctx, const BIGNUM *k,
+ const BIGNUM *peer_scalar, const BIGNUM *server_scalar,
+ const u8 *confirm_peer, const u8 *confirm_server,
+ const u32 *ciphersuite, u8 *msk, u8 *emsk, u8 *session_id)
{
struct crypto_hash *hash;
u8 mk[SHA256_MAC_LEN], *cruft;
@@ -306,7 +307,7 @@ int compute_keys(EAP_PWD_group *grp, BN_CTX *bnctx, BIGNUM *k,
os_free(cruft);
return -1;
}
- eap_pwd_h_update(hash, (u8 *) ciphersuite, sizeof(u32));
+ eap_pwd_h_update(hash, (const u8 *) ciphersuite, sizeof(u32));
offset = BN_num_bytes(grp->order) - BN_num_bytes(peer_scalar);
os_memset(cruft, 0, BN_num_bytes(grp->prime));
BN_bn2bin(peer_scalar, cruft + offset);
diff --git a/src/eap_common/eap_pwd_common.h b/src/eap_common/eap_pwd_common.h
index c54c4414..a0d717ed 100644
--- a/src/eap_common/eap_pwd_common.h
+++ b/src/eap_common/eap_pwd_common.h
@@ -56,10 +56,15 @@ struct eap_pwd_id {
} STRUCT_PACKED;
/* common routines */
-int compute_password_element(EAP_PWD_group *, u16, u8 *, int, u8 *, int, u8 *,
- int, u8 *);
-int compute_keys(EAP_PWD_group *, BN_CTX *, BIGNUM *, BIGNUM *, BIGNUM *,
- u8 *, u8 *, u32 *, u8 *, u8 *, u8 *);
+int compute_password_element(EAP_PWD_group *grp, u16 num,
+ const u8 *password, size_t password_len,
+ const u8 *id_server, size_t id_server_len,
+ const u8 *id_peer, size_t id_peer_len,
+ const u8 *token);
+int compute_keys(EAP_PWD_group *grp, BN_CTX *bnctx, const BIGNUM *k,
+ const BIGNUM *peer_scalar, const BIGNUM *server_scalar,
+ const u8 *confirm_peer, const u8 *confirm_server,
+ const u32 *ciphersuite, u8 *msk, u8 *emsk, u8 *session_id);
struct crypto_hash * eap_pwd_h_init(void);
void eap_pwd_h_update(struct crypto_hash *hash, const u8 *data, size_t len);
void eap_pwd_h_final(struct crypto_hash *hash, u8 *digest);