summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLegrandin <helderijs@gmail.com>2013-02-04 00:11:45 +0100
committerDwayne Litzenberger <dlitz@dlitz.net>2013-10-20 13:30:21 -0700
commitba46e8640f1964f3e747674064ac9ed19ca8e640 (patch)
tree4db1f42129e356e93fa5d27012359ed951ce5a69
parentaf392459f6a1962e676830ddf81e7b6d2667aa8b (diff)
downloadpycrypto-ba46e8640f1964f3e747674064ac9ed19ca8e640.tar.gz
Clarify message about incorrect length in the counter block.
When the counter function returns an incorrect counter block to the cipher in CTR mode, the error message includes both the required and the provided amount of data (in bytes).
-rw-r--r--src/block_template.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/block_template.c b/src/block_template.c
index 964a6f3..f146b43 100644
--- a/src/block_template.c
+++ b/src/block_template.c
@@ -422,8 +422,8 @@ ALG_Encrypt(ALGobject *self, PyObject *args)
Py_BLOCK_THREADS;
PyErr_Format(PyExc_TypeError,
"CTR counter function returned "
- "string not of length %i",
- BLOCK_SIZE);
+ "string of length %i, not %i",
+ ctr->buf_size, BLOCK_SIZE);
free(buffer);
return NULL;
}