Line 0
Link Here
|
|
|
1 |
https://github.com/randombit/botan/pull/1854 |
2 |
Replace upper_bound with lower_bound in pgp_s2k #1854 |
3 |
--- src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp.orig 2019-01-04 11:14:58 UTC |
4 |
+++ src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp |
5 |
@@ -61,7 +61,7 @@ uint8_t RFC4880_encode_count(size_t desired_iterations |
6 |
if(desired_iterations >= OPENPGP_S2K_ITERS[255]) |
7 |
return 255; |
8 |
|
9 |
- auto i = std::upper_bound(OPENPGP_S2K_ITERS, OPENPGP_S2K_ITERS + 256, desired_iterations); |
10 |
+ auto i = std::lower_bound(OPENPGP_S2K_ITERS, OPENPGP_S2K_ITERS + 256, desired_iterations); |
11 |
|
12 |
return static_cast<uint8_t>(i - OPENPGP_S2K_ITERS); |
13 |
} |