Cosmetic changes

This commit is contained in:
wiire-a 2017-12-23 20:00:16 +01:00
parent a55f17b77a
commit a52de0d335
2 changed files with 9 additions and 9 deletions

View File

@ -778,10 +778,10 @@ usage_err:
uint_fast8_t pfound = PIN_ERROR;
vtag_t *vtag;
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_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->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) 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->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) 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;
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;
/* Allocate memory for digests */
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->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) 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;
empty_pin_hmac(wps);

View File

@ -140,18 +140,18 @@ unsigned int bit_revert(unsigned int v)
}
/* 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;
time_t result;
#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 };
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 - 1900) / 100;
result += (year - 1600) / 400;