diff options
author | Jack Lloyd <[email protected]> | 2015-10-26 12:33:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-10-26 12:33:05 -0400 |
commit | 191abfe7c95d79118f0f9b4ed6411796204c0db3 (patch) | |
tree | 672470d35a08dedac63c901f843e113d3088960e /src/lib/pubkey | |
parent | 475a9dacb8d285d6e5a0244bcf816d2ae72a00a8 (diff) | |
parent | 05ca920f0d8461b7da258f4e17afbf3d072b9327 (diff) |
Merge pull request #314 from randombit/ct-tls-cbc-padding
TLS improvements
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/rsa/openssl_rsa.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/lib/pubkey/rsa/openssl_rsa.cpp b/src/lib/pubkey/rsa/openssl_rsa.cpp index f2825634a..44e44b225 100644 --- a/src/lib/pubkey/rsa/openssl_rsa.cpp +++ b/src/lib/pubkey/rsa/openssl_rsa.cpp @@ -11,6 +11,7 @@ #include <botan/internal/openssl.h> #include <botan/internal/pk_utils.h> +#include <botan/internal/ct_utils.h> #include <functional> #include <memory> @@ -35,22 +36,6 @@ std::pair<int, size_t> get_openssl_enc_pad(const std::string& eme) throw Lookup_Error("OpenSSL RSA does not support EME " + eme); } -secure_vector<byte> strip_leading_zeros(const secure_vector<byte>& input) - { - size_t leading_zeros = 0; - - for(size_t i = 0; i != input.size(); ++i) - { - if(input[i] != 0) - break; - ++leading_zeros; - } - - secure_vector<byte> output(&input[leading_zeros], - &input[input.size()]); - return output; - } - class OpenSSL_RSA_Encryption_Operation : public PK_Ops::Encryption { public: @@ -164,8 +149,9 @@ class OpenSSL_RSA_Decryption_Operation : public PK_Ops::Decryption if(m_padding == RSA_NO_PADDING) { - return strip_leading_zeros(buf); + return CT::strip_leading_zeros(buf); } + return buf; } |