mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-28 08:14:39 +02:00
Cosmetic changes
This commit is contained in:
parent
a55f17b77a
commit
a52de0d335
@ -778,10 +778,10 @@ usage_err:
|
|||||||
uint_fast8_t pfound = PIN_ERROR;
|
uint_fast8_t pfound = PIN_ERROR;
|
||||||
vtag_t *vtag;
|
vtag_t *vtag;
|
||||||
if (decrypted5 && decrypted7 && wps->e_hash1 && wps->e_hash2) {
|
if (decrypted5 && decrypted7 && wps->e_hash1 && wps->e_hash2) {
|
||||||
wps->e_s1 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s1) goto memory_err;
|
wps->e_s1 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s1) goto memory_err;
|
||||||
wps->e_s2 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s2) goto memory_err;
|
wps->e_s2 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s2) goto memory_err;
|
||||||
wps->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) goto memory_err;
|
wps->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) goto memory_err;
|
||||||
wps->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) goto memory_err;
|
wps->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) goto memory_err;
|
||||||
wps->empty_psk = malloc(WPS_HASH_LEN); if (!wps->empty_psk) goto memory_err;
|
wps->empty_psk = malloc(WPS_HASH_LEN); if (!wps->empty_psk) goto memory_err;
|
||||||
|
|
||||||
empty_pin_hmac(wps);
|
empty_pin_hmac(wps);
|
||||||
@ -1091,8 +1091,8 @@ usage_err:
|
|||||||
wps->e_s2 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s2) goto memory_err;
|
wps->e_s2 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s2) goto memory_err;
|
||||||
|
|
||||||
/* Allocate memory for digests */
|
/* Allocate memory for digests */
|
||||||
wps->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) goto memory_err;
|
wps->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) goto memory_err;
|
||||||
wps->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) goto memory_err;
|
wps->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) goto memory_err;
|
||||||
wps->empty_psk = malloc(WPS_HASH_LEN); if (!wps->empty_psk) goto memory_err;
|
wps->empty_psk = malloc(WPS_HASH_LEN); if (!wps->empty_psk) goto memory_err;
|
||||||
|
|
||||||
empty_pin_hmac(wps);
|
empty_pin_hmac(wps);
|
||||||
|
@ -140,18 +140,18 @@ unsigned int bit_revert(unsigned int v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Custom timegm function made by Eric S Raymond */
|
/* Custom timegm function made by Eric S Raymond */
|
||||||
time_t c_timegm(register struct tm *t)
|
time_t c_timegm(struct tm *t)
|
||||||
{
|
{
|
||||||
long year;
|
long year;
|
||||||
time_t result;
|
time_t result;
|
||||||
|
|
||||||
#define MONTHS_PER_YEAR 12 /* Months per calendar year */
|
#define MONTHS_PER_YEAR 12 /* Months per calendar year */
|
||||||
|
|
||||||
static const int cumdays[MONTHS_PER_YEAR] =
|
static const int cdays[MONTHS_PER_YEAR] =
|
||||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
|
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
|
||||||
|
|
||||||
year = 1900 + t->tm_year + t->tm_mon / MONTHS_PER_YEAR;
|
year = 1900 + t->tm_year + t->tm_mon / MONTHS_PER_YEAR;
|
||||||
result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHS_PER_YEAR];
|
result = (year - 1970) * 365 + cdays[t->tm_mon % MONTHS_PER_YEAR];
|
||||||
result += (year - 1968) / 4;
|
result += (year - 1968) / 4;
|
||||||
result -= (year - 1900) / 100;
|
result -= (year - 1900) / 100;
|
||||||
result += (year - 1600) / 400;
|
result += (year - 1600) / 400;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user