iPXE
|
SHA-1 algorithm. More...
Go to the source code of this file.
Data Structures | |
struct | sha1_digest |
An SHA-1 digest. More... | |
union | sha1_block |
An SHA-1 data block. More... | |
struct | sha1_digest_data |
SHA-1 digest and data block. More... | |
union | sha1_digest_data_dwords |
SHA-1 digest and data block. More... | |
struct | sha1_context |
An SHA-1 context. More... | |
Macros | |
#define | SHA1_CTX_SIZE sizeof ( struct sha1_context ) |
SHA-1 context size. More... | |
#define | SHA1_BLOCK_SIZE sizeof ( union sha1_block ) |
SHA-1 block size. More... | |
#define | SHA1_DIGEST_SIZE sizeof ( struct sha1_digest ) |
SHA-1 digest size. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
void | prf_sha1 (const void *key, size_t key_len, const char *label, const void *data, size_t data_len, void *prf, size_t prf_len) |
SHA1 pseudorandom function for creating derived keys. More... | |
void | pbkdf2_sha1 (const void *passphrase, size_t pass_len, const void *salt, size_t salt_len, int iterations, void *key, size_t key_len) |
PBKDF2 key derivation function using SHA1. More... | |
Variables | |
struct digest_algorithm | sha1_algorithm |
SHA-1 algorithm. More... | |
SHA-1 algorithm.
Definition in file sha1.h.
#define SHA1_CTX_SIZE sizeof ( struct sha1_context ) |
#define SHA1_BLOCK_SIZE sizeof ( union sha1_block ) |
#define SHA1_DIGEST_SIZE sizeof ( struct sha1_digest ) |
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
void prf_sha1 | ( | const void * | key, |
size_t | key_len, | ||
const char * | label, | ||
const void * | data, | ||
size_t | data_len, | ||
void * | prf, | ||
size_t | prf_len | ||
) |
SHA1 pseudorandom function for creating derived keys.
key | Master key with which this call is associated |
key_len | Length of key |
label | NUL-terminated ASCII string describing purpose of PRF data |
data | Further data that should be included in the PRF |
data_len | Length of further PRF data |
prf_len | Bytes of PRF to generate |
prf | Pseudorandom function bytes |
This is the PRF variant used by 802.11, defined in IEEE 802.11-2007 8.5.5.1. EAP-FAST uses a different SHA1-based PRF, and TLS uses an MD5-based PRF.
Definition at line 44 of file sha1extra.c.
References ctx, data, data_len, hmac_final(), hmac_init(), hmac_update(), in, key, memcpy(), out, sha1_algorithm, SHA1_BLOCK_SIZE, SHA1_CTX_SIZE, SHA1_DIGEST_SIZE, and strlen().
Referenced by wpa_derive_ptk().
void pbkdf2_sha1 | ( | const void * | passphrase, |
size_t | pass_len, | ||
const void * | salt, | ||
size_t | salt_len, | ||
int | iterations, | ||
void * | key, | ||
size_t | key_len | ||
) |
PBKDF2 key derivation function using SHA1.
passphrase | Passphrase from which to derive key |
pass_len | Length of passphrase |
salt | Salt to include in key |
salt_len | Length of salt |
iterations | Number of iterations of SHA1 to perform |
key_len | Length of key to generate |
key | Generated key bytes |
This is used most notably in 802.11 WPA passphrase hashing, in which case the salt is the SSID, 4096 iterations are used, and a 32-byte key is generated that serves as the Pairwise Master Key for EAPOL authentication.
The operation of this function is further described in RFC 2898.
Definition at line 148 of file sha1extra.c.
References key, memcpy(), pbkdf2_sha1_f(), and SHA1_DIGEST_SIZE.
Referenced by wpa_psk_start().
struct digest_algorithm sha1_algorithm |
SHA-1 algorithm.
Definition at line 257 of file sha1.c.
Referenced by ccmp_kie_mic(), certstat(), md5_sha1_final(), md5_sha1_init(), md5_sha1_update(), mschapv2_auth(), mschapv2_challenge_hash(), ocsp_compare_responder_key_hash(), pbkdf2_sha1_f(), prf_sha1(), sha1_test_exec(), sha1sum_exec(), tls_prf(), and x509_name().