diff options
author | rodri <rgl@antares-labs.eu> | 2023-02-11 23:21:00 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-02-11 23:21:00 +0000 |
commit | 62e75d8830eb56ab03bd4689d51ffd6d4150f461 (patch) | |
tree | 5c84e92fbb3df890adeed7ba5f06ecda95b6e83e /fmt.c | |
parent | 775309861b51dd1f340d82074b7e9234f3e0675e (diff) | |
download | musw-62e75d8830eb56ab03bd4689d51ffd6d4150f461.tar.gz musw-62e75d8830eb56ab03bd4689d51ffd6d4150f461.tar.bz2 musw-62e75d8830eb56ab03bd4689d51ffd6d4150f461.zip |
implemented per-packet HMAC to avoid MITM tampering.
Diffstat (limited to 'fmt.c')
-rw-r--r-- | fmt.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#include <u.h> +#include <libc.h> +#include <ip.h> +#include <mp.h> +#include <libsec.h> +#include <thread.h> +#include <draw.h> +#include <geometry.h> +#include "dat.h" +#include "fns.h" + +int +Φfmt(Fmt *f) +{ + int n, i; + Frame *frame; + + frame = va_arg(f->args, Frame*); + + n = fmtprint(f, "id %x type %ud seq %ud ack %ud len %ud sig ", + frame->id, frame->type, frame->seq, frame->ack, frame->len); + for(i = 0; i < MD5dlen; i++) + n += fmtprint(f, "%2.2x", frame->sig[i]); + return n; +} |