Skip to content
Snippets Groups Projects
Commit a1106ee5 authored by Bernard Blackham's avatar Bernard Blackham
Browse files

Stage without sha1.

parent e0b5b67c
No related merge requests found
...@@ -30,6 +30,12 @@ void delay(u16 ms) { ...@@ -30,6 +30,12 @@ void delay(u16 ms) {
" pulx\n");*/ " pulx\n");*/
} }
u8 my_strlen(char* s) {
char *p = s;
while (*p) p++;
return p-s;
}
void my_strncpy(char* dst, char* src, u8 max_size) { void my_strncpy(char* dst, char* src, u8 max_size) {
u8 i; u8 i;
for (i = 0; src[i] && i < max_size; i++) dst[i] = src[i]; for (i = 0; src[i] && i < max_size; i++) dst[i] = src[i];
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "sci.h" #include "sci.h"
#include "vend.h" #include "vend.h"
#include "xmodem.h" #include "xmodem.h"
#include "sha1.h"
u8 last_standalone; u8 last_standalone;
u8 last_switch_input; u8 last_switch_input;
...@@ -372,6 +373,9 @@ void quit() { ...@@ -372,6 +373,9 @@ void quit() {
unknown_command(); unknown_command();
} }
//SHA1_CTX ctx;
//u8 sha1_digest[SHA1_SIGNATURE_SIZE];
int main() { int main() {
u8 i; u8 i;
for (i = 0; i < 11; i++) for (i = 0; i < 11; i++)
...@@ -451,6 +455,11 @@ int main() { ...@@ -451,6 +455,11 @@ int main() {
} }
if (sci_have_packet) { if (sci_have_packet) {
if (must_verify()) {
//SHA1_Init(&ctx);
//SHA1_Update(&ctx, sci_rx_buf, my_strlen(sci_rx_buf));
//SHA1_Final(sha1_digest, &ctx);
}
switch (sci_rx_buf[0]) { switch (sci_rx_buf[0]) {
case '\0': case '\0':
case '#': case '#':
......
...@@ -27,6 +27,7 @@ extern volatile u8 _home_sensors; ...@@ -27,6 +27,7 @@ extern volatile u8 _home_sensors;
#define home_sensors _home_sensors #define home_sensors _home_sensors
#define is_standalone() (misc_input & 0x01) /* DIP sw 1 */ #define is_standalone() (misc_input & 0x01) /* DIP sw 1 */
#define must_verify() (misc_input & 0x02) /* DIP sw 2 */
extern u16 _stack; extern u16 _stack;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment