aboutsummaryrefslogtreecommitdiffstats
path: root/src/pbe/pbes2
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-25 23:56:05 +0000
committerlloyd <[email protected]>2012-05-25 23:56:05 +0000
commitd956f632061cb80f3d7a3ee2b6b4f384dcc73145 (patch)
treec045eeabc4f98c1eb9b5e3e20bcb23370087869a /src/pbe/pbes2
parent12090a7148d9ee73572cc1a7268fc489504a8173 (diff)
Some post merge fixups.
Fix some bugs that triggered if DEFAULT_BUFFERSIZE was either too small or an odd size.
Diffstat (limited to 'src/pbe/pbes2')
-rw-r--r--src/pbe/pbes2/pbes2.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp
index 752a4fb6d..0036359cc 100644
--- a/src/pbe/pbes2/pbes2.cpp
+++ b/src/pbe/pbes2/pbes2.cpp
@@ -26,13 +26,8 @@ namespace Botan {
*/
void PBE_PKCS5v20::write(const byte input[], size_t length)
{
- while(length)
- {
- size_t put = std::min(DEFAULT_BUFFERSIZE, length);
- pipe.write(input, length);
- flush_pipe(true);
- length -= put;
- }
+ pipe.write(input, length);
+ flush_pipe(true);
}
/*
@@ -75,7 +70,7 @@ void PBE_PKCS5v20::flush_pipe(bool safe_to_skip)
secure_vector<byte> buffer(DEFAULT_BUFFERSIZE);
while(pipe.remaining())
{
- size_t got = pipe.read(&buffer[0], buffer.size());
+ const size_t got = pipe.read(&buffer[0], buffer.size());
send(buffer, got);
}
}