Fix off-by-one error.

Apart from writing 1 byte beyond an array allocated on the stack, this slipped
an unitialized byte in the seed used for key generation.
This commit is contained in:
Guus Sliepen 2012-10-06 16:53:43 +02:00
parent 20b441a6de
commit 47f33e07ff

View file

@ -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 + 78, s->label, s->labellen);
memcpy(seed + 77, s->label, s->labellen);
// Use PRF to generate the key material
if(!prf(shared, len, seed, s->labellen + 64 + 13, s->key, keylen))