Expose OpenSSLWrapper to Python (as requested)

This commit is contained in:
rdb
2015-01-07 23:04:48 +01:00
parent 6ce891f748
commit 3c30c8de56
2 changed files with 40 additions and 1 deletions
+36
View File
@@ -12,3 +12,39 @@
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: OpenSSLWrapper::load_certificates_from_pem_ram
// Access: Public
// Description: Reads a chain of trusted certificates from the
// indicated data buffer and adds them to the X509_STORE
// object. The data buffer should be PEM-formatted.
// Returns the number of certificates read on success,
// or 0 on failure.
//
// You should call this only with trusted,
// locally-stored certificates; not with certificates
// received from an untrusted source.
////////////////////////////////////////////////////////////////////
INLINE int OpenSSLWrapper::
load_certificates_from_pem_ram(const string &data) {
return load_certificates_from_pem_ram(data.data(), data.size());
}
////////////////////////////////////////////////////////////////////
// Function: OpenSSLWrapper::load_certificates_from_der_ram
// Access: Public
// Description: Reads a chain of trusted certificates from the
// indicated data buffer and adds them to the X509_STORE
// object. The data buffer should be DER-formatted.
// Returns the number of certificates read on success,
// or 0 on failure.
//
// You should call this only with trusted,
// locally-stored certificates; not with certificates
// received from an untrusted source.
////////////////////////////////////////////////////////////////////
INLINE int OpenSSLWrapper::
load_certificates_from_der_ram(const string &data) {
return load_certificates_from_der_ram(data.data(), data.size());
}
+4 -1
View File
@@ -48,12 +48,15 @@ private:
OpenSSLWrapper();
~OpenSSLWrapper();
public:
PUBLISHED:
void clear_certificates();
int load_certificates(const Filename &filename);
int load_certificates_from_pem_ram(const char *data, size_t data_size);
int load_certificates_from_der_ram(const char *data, size_t data_size);
INLINE int load_certificates_from_pem_ram(const string &data);
INLINE int load_certificates_from_der_ram(const string &data);
X509_STORE *get_x509_store();
void notify_ssl_errors();