Fixed a potential bug where the NULL-termination of the base64-encoded data was being lost during process just before rijndael decryption.

git-svn-id: file:///home/mbr/svn/fwknop/trunk@41 510a4753-2344-4c79-9c09-4d669213fbeb
This commit is contained in:
Damien Stuart 2009-01-25 15:50:52 +00:00
parent e846cdd44d
commit 9ebdb622a0

View File

@ -104,6 +104,13 @@ _rijndael_decrypt(fko_ctx_t ctx, const char *dec_key, int b64_len)
memmove(tbuf+10, tbuf, b64_len);
ctx->encrypted_msg = memcpy(tbuf, B64_RIJNDAEL_SALT, strlen(B64_RIJNDAEL_SALT));
/* Adjust b64_len for added SALT value and Make sure we are still
* a properly NULL-terminated string (Ubuntu was one system for
* which this was an issue).
*/
b64_len += 10;
tbuf[b64_len] = '\0';
}
/* Create a bucket for the (base64) decoded encrypted data and get the