diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-11-03 18:52:03 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-11-03 20:54:36 (GMT) |
commit | 7a26e76bd05283fcc329469d25a2640107966603 (patch) | |
tree | 6aaab1a11cc344d5dd59302450ba70c350963847 /Swiften/TLS/OpenSSL | |
parent | 7b0795215f601a9561dbedbed3af32dbe9aba032 (diff) | |
download | swift-7a26e76bd05283fcc329469d25a2640107966603.zip swift-7a26e76bd05283fcc329469d25a2640107966603.tar.bz2 |
Quick brush up after previous patch.
Includes:
Initial cleanup of SChannel code; compiling on non-Windows
Be willing to compile Swift with SChannel
Undo some (presumably accidental) OpenSSL changes
Where TLS doesn't support finish messages (SChannel), don't try -PLUS
Diffstat (limited to 'Swiften/TLS/OpenSSL')
-rw-r--r-- | Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp index ac36f4f..76b8bb9 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp @@ -36,6 +36,9 @@ OpenSSLCertificate::OpenSSLCertificate(const ByteArray& der) { ByteArray OpenSSLCertificate::toDER() const { ByteArray result; + if (!cert) { + return result; + } result.resize(i2d_X509(cert.get(), NULL)); unsigned char* p = vecptr(result); i2d_X509(cert.get(), &p); @@ -43,6 +46,9 @@ ByteArray OpenSSLCertificate::toDER() const { } void OpenSSLCertificate::parse() { + if (!cert) { + return; + } // Subject name X509_NAME* subjectName = X509_get_subject_name(cert.get()); if (subjectName) { |