Skip to content

Commit 7dc6df9

Browse files
author
D. Teuchert
committed
minor improvement
1 parent 89d5b7a commit 7dc6df9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

modules/GPS_module/src/GPS_module_1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ enum GPS_return_status get_current_position(GPS_position * position) {
3737
uint8_t hmac_as_bytes[HMAC_LENGTH];
3838
if (GPS_driver_obtain_current_position(position_as_bytes, hmac_as_bytes) == 0) {
3939
if (crypto_verify_hmac(position_as_bytes, 16, hmac_as_bytes) == valid_hmac) {
40-
GPS_position current_position = {
40+
GPS_position pos = {
4141
position_as_bytes[0] << 1 + position_as_bytes[1],
4242
position_as_bytes[2] << 1 + position_as_bytes[3],
4343
position_as_bytes[4] << 1 + position_as_bytes[5],
4444
position_as_bytes[6] << 1 + position_as_bytes[7],
4545
position_as_bytes[8] << 1 + position_as_bytes[9],
4646
position_as_bytes[10] << 1 + position_as_bytes[11]
4747
};
48+
*position = pos;
4849
return GPS_success;
4950
}
5051
}

modules/GPS_module/src/GPS_module_1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "GPS_module_types.h"
55

6-
extern int GPS_driver_obtain_current_position(uint8_t * position_as_bytes, uint8_t * hmac_as_bytes);
6+
extern uint8_t GPS_driver_obtain_current_position(uint8_t * position_as_bytes, uint8_t * hmac_as_bytes);
77

88
enum GPS_return_status init_crypto_module();
99

modules/crypto_module/src/crypto_module_1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "crypto_module_types.h"
77

8-
extern int third_party_library_calc_hmac(uint8_t * const message, int len, char * const key, char * const nonce, uint8_t * hmac);
8+
extern uint8_t third_party_library_calc_hmac(uint8_t * const message, int len, char * const key, char * const nonce, uint8_t * hmac);
99

1010
void crypto_init();
1111

0 commit comments

Comments
 (0)