projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20b441a
)
Fix off-by-one error.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 6 Oct 2012 14:53:43 +0000
(16:53 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 6 Oct 2012 14:53:43 +0000
(16:53 +0200)
Apart from writing 1 byte beyond an array allocated on the stack, this slipped
an unitialized byte in the seed used for key generation.
src/sptps.c
patch
|
blob
|
history
diff --git
a/src/sptps.c
b/src/sptps.c
index
b907dad
..
3b9498c
100644
(file)
--- a/
src/sptps.c
+++ b/
src/sptps.c
@@
-209,7
+209,7
@@
static bool generate_key_material(sptps_t *s, const char *shared, size_t len) {
memcpy(seed + 13, s->hiskex + 1, 32);
memcpy(seed + 45, s->mykex + 1, 32);
}
- memcpy(seed + 7
8
, s->label, s->labellen);
+ memcpy(seed + 7
7
, s->label, s->labellen);
// Use PRF to generate the key material
if(!prf(shared, len, seed, s->labellen + 64 + 13, s->key, keylen))