diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/ms_funcs.c | 2 | ||||
-rw-r--r-- | src/crypto/rc4.c | 16 | ||||
-rw-r--r-- | src/crypto/rc4.h | 1 | ||||
-rw-r--r-- | src/eapol_supp/eapol_supp_sm.c | 4 |
4 files changed, 3 insertions, 20 deletions
diff --git a/src/crypto/ms_funcs.c b/src/crypto/ms_funcs.c index 9c5b2f9..9839a7d 100644 --- a/src/crypto/ms_funcs.c +++ b/src/crypto/ms_funcs.c @@ -404,7 +404,7 @@ int encrypt_pw_block_with_password_hash( */ pos = &pw_block[2 * 256]; WPA_PUT_LE16(pos, password_len * 2); - rc4(pw_block, PWBLOCK_LEN, password_hash, 16); + rc4_skip(password_hash, 16, 0, pw_block, PWBLOCK_LEN); return 0; } diff --git a/src/crypto/rc4.c b/src/crypto/rc4.c index 8480cc5..70c790e 100644 --- a/src/crypto/rc4.c +++ b/src/crypto/rc4.c @@ -68,19 +68,3 @@ void rc4_skip(const u8 *key, size_t keylen, size_t skip, *pos++ ^= S[(S[i] + S[j]) & 0xff]; } } - - -/** - * rc4 - XOR RC4 stream to given data - * @buf: data to be XOR'ed with RC4 stream - * @len: buf length - * @key: RC4 key - * @key_len: RC4 key length - * - * Generate RC4 pseudo random stream for the given key and XOR this with the - * data buffer to perform RC4 encryption/decryption. - */ -void rc4(u8 *buf, size_t len, const u8 *key, size_t key_len) -{ - rc4_skip(key, key_len, 0, buf, len); -} diff --git a/src/crypto/rc4.h b/src/crypto/rc4.h index 01f1383..35c7e41 100644 --- a/src/crypto/rc4.h +++ b/src/crypto/rc4.h @@ -17,6 +17,5 @@ void rc4_skip(const u8 *key, size_t keylen, size_t skip, u8 *data, size_t data_len); -void rc4(u8 *buf, size_t len, const u8 *key, size_t key_len); #endif /* RC4_H */ diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c index e4c0700..58e6221 100644 --- a/src/eapol_supp/eapol_supp_sm.c +++ b/src/eapol_supp/eapol_supp_sm.c @@ -750,8 +750,8 @@ static void eapol_sm_processKey(struct eapol_sm *sm) os_memcpy(ekey + IEEE8021X_KEY_IV_LEN, keydata.encr_key, encr_key_len); os_memcpy(datakey, key + 1, key_len); - rc4(datakey, key_len, ekey, - IEEE8021X_KEY_IV_LEN + encr_key_len); + rc4_skip(ekey, IEEE8021X_KEY_IV_LEN + encr_key_len, 0, + datakey, key_len); wpa_hexdump_key(MSG_DEBUG, "EAPOL: Decrypted(RC4) key", datakey, key_len); } else if (key_len == 0) { |