From 70a46a5b9059aa6b08a8f206406d1e856544ea3e Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 22 Sep 2017 19:12:02 -0400 Subject: Reject very small inputs to the package transform Causes breakage - #825 --- src/lib/misc/aont/package.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib') diff --git a/src/lib/misc/aont/package.cpp b/src/lib/misc/aont/package.cpp index 9c106e1d0..c9dd3dada 100644 --- a/src/lib/misc/aont/package.cpp +++ b/src/lib/misc/aont/package.cpp @@ -18,6 +18,9 @@ void aont_package(RandomNumberGenerator& rng, const uint8_t input[], size_t input_len, uint8_t output[]) { + if(input_len <= 1) + throw Encoding_Error("Package transform cannot encode small inputs"); + const size_t BLOCK_SIZE = cipher->block_size(); if(!cipher->valid_keylength(BLOCK_SIZE)) -- cgit v1.2.3