Simplify CryptoSSLRequestManager using unified futures API
authorAnirudh Ramachandran <avr@fb.com>
Mon, 2 May 2016 16:12:01 +0000 (09:12 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Mon, 2 May 2016 16:20:21 +0000 (09:20 -0700)
Summary:
This diff unifies the nearly-replicated call paths for ECDSA and RSA
sign request/response/fallback/etc. into one generic futures-based sign API.
Once this is tested, we should be able to remove ~500 lines of code from
CryptoSSLRequestManager

Depends on D3094660

Reviewed By: siyengar

Differential Revision: D3116535

fb-gh-sync-id: 11c50d81dab39e5426679b5a172c1ece2039fc10
fbshipit-source-id: 11c50d81dab39e5426679b5a172c1ece2039fc10

folly/io/async/ssl/OpenSSLPtrTypes.h

index 7948c62af2ac0e07bab68b811cb504b863b26255..b39c3e8740fad66301618047e0ef317b53f1b83b 100644 (file)
@@ -17,6 +17,7 @@
 #pragma once
 
 #include <glog/logging.h>
+#include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/rsa.h>
 #include <openssl/ssl.h>
@@ -76,6 +77,10 @@ using EcKeyDeleter = folly::static_function_deleter<EC_KEY, &EC_KEY_free>;
 using EcKeyUniquePtr = std::unique_ptr<EC_KEY, EcKeyDeleter>;
 #endif
 
+// BIGNUMs
+using BIGNUMDeleter = folly::static_function_deleter<BIGNUM, &BN_clear_free>;
+using BIGNUMUniquePtr = std::unique_ptr<BIGNUM, BIGNUMDeleter>;
+
 // SSL and SSL_CTX
 using SSLDeleter = folly::static_function_deleter<SSL, &SSL_free>;
 using SSLUniquePtr = std::unique_ptr<SSL, SSLDeleter>;