summaryrefslogtreecommitdiff
path: root/controller/fw/tools/crypto_test.c
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-10 12:20:55 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-10 12:20:55 +0100
commit0cd07d397fb5a5e7710af66cb1e9e0b61705c94a (patch)
tree165d2e639614ae662f552b0d5cd88b3d8041f1db /controller/fw/tools/crypto_test.c
parent6880468862a498d359a0a6ed4bd9dd116a478fa9 (diff)
downloadmaster-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.tar.gz
master-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.tar.bz2
master-thesis-0cd07d397fb5a5e7710af66cb1e9e0b61705c94a.zip
Crypto v2 draft working
Diffstat (limited to 'controller/fw/tools/crypto_test.c')
-rw-r--r--controller/fw/tools/crypto_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/controller/fw/tools/crypto_test.c b/controller/fw/tools/crypto_test.c
index 8552117..410fac2 100644
--- a/controller/fw/tools/crypto_test.c
+++ b/controller/fw/tools/crypto_test.c
@@ -30,7 +30,7 @@ int main(int argc, char **argv) {
uint8_t auth_key[16];
- for (size_t i=0; argv[1][i+0] != '\0' && argv[1][i+1] != '\0'; i+= 2) {
+ for (size_t i=0; argv[1][i+0] != '\0' && argv[1][i+1] != '\0' && i/2<sizeof(auth_key); i+= 2) {
char buf[3] = { argv[1][i+0], argv[1][i+1], 0};
char *endptr;
auth_key[i/2] = strtoul(buf, &endptr, 16);