Summary:
The ASN1_TIME is the typically used within OpenSSL for representing
time. For example, it can be used to represent the NotBefore and NotAfter
properties of a certificate to be verified. This diff introduces a
ASN1TimeUniquePtr type to take care of the ownership of the ASN1_TIME.
Reviewed By: yfeldblum
Differential Revision:
D3561274
fbshipit-source-id:
ca4d1431b33098cccd727253dd301e209d2561a5
#pragma once
#include <glog/logging.h>
#pragma once
#include <glog/logging.h>
+
+#include <openssl/asn1.h>
+#include <openssl/bio.h>
-#include <openssl/evp.h>
-#include <openssl/rsa.h>
-#include <openssl/ssl.h>
#ifndef OPENSSL_NO_EC
#include <openssl/ec.h>
#endif
#ifndef OPENSSL_NO_EC
#include <openssl/ec.h>
#endif
-#include <folly/Memory.h>
-#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <openssl/rsa.h>
+#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/x509.h>
+#include <folly/Memory.h>
+
namespace folly {
namespace ssl {
namespace folly {
namespace ssl {
+// ASN1
+using ASN1TimeDeleter =
+ folly::static_function_deleter<ASN1_TIME, &ASN1_TIME_free>;
+using ASN1TimeUniquePtr = std::unique_ptr<ASN1_TIME, ASN1TimeDeleter>;
+
// X509
using X509Deleter = folly::static_function_deleter<X509, &X509_free>;
using X509UniquePtr = std::unique_ptr<X509, X509Deleter>;
// X509
using X509Deleter = folly::static_function_deleter<X509, &X509_free>;
using X509UniquePtr = std::unique_ptr<X509, X509Deleter>;