clean up build: GCC warnings

This commit is contained in:
yparitcher
2019-01-06 01:19:14 -05:00
parent 23c140fd99
commit 400b37a96a
16 changed files with 150 additions and 85 deletions

View File

@@ -11,11 +11,16 @@
#include "log.h"
#include "device.h"
#include "wallet.h"
#ifdef ENABLE_U2F_EXTENSIONS
#include "extensions.h"
#endif
#include APP_CONFIG
// void u2f_response_writeback(uint8_t * buf, uint8_t len);
#ifdef ENABLE_U2F
static int16_t u2f_register(struct u2f_register_request * req);
static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t control);
#endif
int8_t u2f_response_writeback(const uint8_t * buf, uint16_t len);
void u2f_reset_response();
@@ -25,7 +30,11 @@ static CTAP_RESPONSE * _u2f_resp = NULL;
void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
{
uint16_t rcode = 0;
#ifdef ENABLE_U2F
#if DEBUG_LEVEL > 0
uint64_t t1,t2;
#endif
#endif
uint32_t len = ((req->LC3) | ((uint32_t)req->LC2 << 8) | ((uint32_t)req->LC1 << 16));
uint8_t byte;
@@ -53,18 +62,26 @@ void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
}
else
{
#if DEBUG_LEVEL > 0
t1 = millis();
#endif
rcode = u2f_register((struct u2f_register_request*)req->payload);
#if DEBUG_LEVEL > 0
t2 = millis();
printf1(TAG_TIME,"u2f_register time: %d ms\n", t2-t1);
#endif
}
break;
case U2F_AUTHENTICATE:
printf1(TAG_U2F, "U2F_AUTHENTICATE\n");
#if DEBUG_LEVEL > 0
t1 = millis();
#endif
rcode = u2f_authenticate((struct u2f_authenticate_request*)req->payload, req->p1);
#if DEBUG_LEVEL > 0
t2 = millis();
printf1(TAG_TIME,"u2f_authenticate time: %d ms\n", t2-t1);
#endif
break;
case U2F_VERSION:
printf1(TAG_U2F, "U2F_VERSION\n");
@@ -128,6 +145,7 @@ void u2f_set_writeback_buffer(CTAP_RESPONSE * resp)
_u2f_resp = resp;
}
#ifdef ENABLE_U2F
static void dump_signature_der(uint8_t * sig)
{
uint8_t sigder[72];
@@ -300,6 +318,7 @@ static int16_t u2f_register(struct u2f_register_request * req)
return U2F_SW_NO_ERROR;
}
#endif
int16_t u2f_version()
{