Commit 81957665 authored by Saurabh Singh's avatar Saurabh Singh Committed by Facebook Github Bot 8

Adding std::unique_ptr definition for the ASN1_TIME type.

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
parent 8ba9a001
...@@ -17,20 +17,28 @@ ...@@ -17,20 +17,28 @@
#pragma once #pragma once
#include <glog/logging.h> #include <glog/logging.h>
#include <openssl/asn1.h>
#include <openssl/bio.h>
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/ssl.h>
#ifndef OPENSSL_NO_EC #ifndef OPENSSL_NO_EC
#include <openssl/ec.h> #include <openssl/ec.h>
#endif #endif
#include <folly/Memory.h> #include <openssl/evp.h>
#include <openssl/bio.h> #include <openssl/rsa.h>
#include <openssl/ssl.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#include <folly/Memory.h>
namespace folly { namespace folly {
namespace ssl { namespace ssl {
// ASN1
using ASN1TimeDeleter =
folly::static_function_deleter<ASN1_TIME, &ASN1_TIME_free>;
using ASN1TimeUniquePtr = std::unique_ptr<ASN1_TIME, ASN1TimeDeleter>;
// X509 // X509
using X509Deleter = folly::static_function_deleter<X509, &X509_free>; using X509Deleter = folly::static_function_deleter<X509, &X509_free>;
using X509UniquePtr = std::unique_ptr<X509, X509Deleter>; using X509UniquePtr = std::unique_ptr<X509, X509Deleter>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment