From 77afd52c616f50f5213b24f9b2df0d27e61c95f2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 15 Oct 2007 15:17:43 +0000 Subject: Truncate the X9.42 PRF output if the counter overflows. --- src/prf_x942.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/prf_x942.cpp b/src/prf_x942.cpp index fd29aecdd..99f223107 100644 --- a/src/prf_x942.cpp +++ b/src/prf_x942.cpp @@ -40,7 +40,7 @@ SecureVector X942_PRF::derive(u32bit key_len, SecureVector key; u32bit counter = 1; - while(key.size() != key_len) + while(key.size() != key_len && counter) { hash->update(secret, secret_len); -- cgit v1.2.3