mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-27 15:54:29 +02:00
Got rid of some warnings
This commit is contained in:
parent
8de0422164
commit
feeb389017
@ -22,8 +22,6 @@
|
|||||||
#define ENDIANNESS_PORTABLE_CONVERSION
|
#define ENDIANNESS_PORTABLE_CONVERSION
|
||||||
#include "endianness.h"
|
#include "endianness.h"
|
||||||
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
|
|
||||||
#include "mbedtls/md_internal.h"
|
#include "mbedtls/md_internal.h"
|
||||||
#include "mbedtls/sha256.h"
|
#include "mbedtls/sha256.h"
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ static void init_crack_jobs(struct global *wps, int mode)
|
|||||||
uint32_t curr = (mode == RTL819x) ? wps->start : 0;
|
uint32_t curr = (mode == RTL819x) ? wps->start : 0;
|
||||||
int32_t add = (mode == RTL819x) ? -SEEDS_PER_JOB_BLOCK : SEEDS_PER_JOB_BLOCK;
|
int32_t add = (mode == RTL819x) ? -SEEDS_PER_JOB_BLOCK : SEEDS_PER_JOB_BLOCK;
|
||||||
for (i = 0; i < wps->jobs; i++) {
|
for (i = 0; i < wps->jobs; i++) {
|
||||||
job_control.crack_jobs[i].start = (mode == -RTL819x) ? i + 1 : curr;
|
job_control.crack_jobs[i].start = (mode == -RTL819x) ? (uint32_t)i + 1 : curr;
|
||||||
setup_thread(i);
|
setup_thread(i);
|
||||||
curr += add;
|
curr += add;
|
||||||
}
|
}
|
||||||
@ -1482,12 +1482,12 @@ static int int_pow(int a, int exp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* return non-zero if pin half is correct, zero otherwise */
|
/* return non-zero if pin half is correct, zero otherwise */
|
||||||
static int check_pin_half(const uint8_t pinhalf[4], uint8_t *psk, const uint8_t *es, struct global *wps, const uint8_t *ehash)
|
static int check_pin_half(const char pinhalf[4], uint8_t *psk, const uint8_t *es, struct global *wps, const uint8_t *ehash)
|
||||||
{
|
{
|
||||||
uint8_t buffer[WPS_SECRET_NONCE_LEN + WPS_PSK_LEN + WPS_PKEY_LEN * 2];
|
uint8_t buffer[WPS_SECRET_NONCE_LEN + WPS_PSK_LEN + WPS_PKEY_LEN * 2];
|
||||||
uint8_t result[WPS_HASH_LEN];
|
uint8_t result[WPS_HASH_LEN];
|
||||||
|
|
||||||
hmac_sha256(wps->authkey, WPS_AUTHKEY_LEN, pinhalf, 4, psk);
|
hmac_sha256(wps->authkey, WPS_AUTHKEY_LEN, (unsigned char *)pinhalf, 4, psk);
|
||||||
memcpy(buffer, es, WPS_SECRET_NONCE_LEN);
|
memcpy(buffer, es, WPS_SECRET_NONCE_LEN);
|
||||||
memcpy(buffer + WPS_SECRET_NONCE_LEN, psk, WPS_PSK_LEN);
|
memcpy(buffer + WPS_SECRET_NONCE_LEN, psk, WPS_PSK_LEN);
|
||||||
memcpy(buffer + WPS_SECRET_NONCE_LEN + WPS_PSK_LEN, wps->pke, WPS_PKEY_LEN);
|
memcpy(buffer + WPS_SECRET_NONCE_LEN + WPS_PSK_LEN, wps->pke, WPS_PKEY_LEN);
|
||||||
|
@ -87,7 +87,7 @@ const uint8_t rtl_rnd_seed[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct global {
|
struct global {
|
||||||
uint8_t pin[WPS_PIN_LEN + 1];
|
char pin[WPS_PIN_LEN + 1];
|
||||||
uint8_t *pke;
|
uint8_t *pke;
|
||||||
uint8_t *pkr;
|
uint8_t *pkr;
|
||||||
uint8_t *e_key;
|
uint8_t *e_key;
|
||||||
|
@ -128,7 +128,7 @@ int get_int(char *in, int *out)
|
|||||||
|
|
||||||
unsigned int bit_revert(unsigned int v)
|
unsigned int bit_revert(unsigned int v)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
unsigned int lsb, n = 0;
|
unsigned int lsb, n = 0;
|
||||||
for (i = 0; i < sizeof(unsigned int) * 8; i++) {
|
for (i = 0; i < sizeof(unsigned int) * 8; i++) {
|
||||||
lsb = v & 1;
|
lsb = v & 1;
|
||||||
@ -241,7 +241,7 @@ unsigned long get_elapsed_ms(struct timeval *start, struct timeval *end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Converts an unsigned integer to a char array without termination */
|
/* Converts an unsigned integer to a char array without termination */
|
||||||
static inline void uint_to_char_array(unsigned int num, unsigned int len, uint8_t *dst)
|
static inline void uint_to_char_array(unsigned int num, unsigned int len, char *dst)
|
||||||
{
|
{
|
||||||
unsigned int mul = 1;
|
unsigned int mul = 1;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user