Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC4880_encode_count doesn't return consistent results when processing exact iterations #1853

Closed
evpo opened this issue Mar 10, 2019 · 0 comments

Comments

@evpo
Copy link
Contributor

evpo commented Mar 10, 2019

The function returns RFC4880 code + 1 when given exact iterations. The code below demonstrates this behavior:

using namespace Botan;
std::stringstream size_t decode_result = OpenPGP_S2K::decode_count(160U);
stm << " decode(160)=" << decode_result << '\n';
stm << " encode(" << decode_result << ")=" <<
    static_cast<unsigned>(OpenPGP_S2K::encode_count(decode_result)) << '\n';

Output:

decode(160)=1048576
encode(1048576)=161

This issue is related: evpo/EncryptPad#82

The behavior makes it impossible to open encrypted files.

PR is coming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant