diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-14 21:58:27 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-14 21:58:27 +0000 |
| commit | 564f68cb2c258e61c1e70950c9d036859ea8619a (patch) | |
| tree | eb0461de7da287b55060e406d55dc6bb7325b294 /src | |
| parent | 312540e64966e15d2c8df7f82610ce05008b1329 (diff) | |
A few asserts.
Diffstat (limited to 'src')
| -rw-r--r-- | src/certificates.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/certificates.cc b/src/certificates.cc index c1b15c51..372f8571 100644 --- a/src/certificates.cc +++ b/src/certificates.cc @@ -63,6 +63,8 @@ Certificate::~Certificate () string Certificate::certificate () const { + assert (_certificate); + BIO* bio = BIO_new (BIO_s_mem ()); if (!bio) { throw MiscError ("could not create memory BIO"); @@ -87,6 +89,8 @@ Certificate::certificate () const string Certificate::issuer () const { + assert (_certificate); + X509_NAME* n = X509_get_issuer_name (_certificate); assert (n); @@ -115,6 +119,8 @@ Certificate::name_for_xml (string const & n) string Certificate::subject () const { + assert (_certificate); + X509_NAME* n = X509_get_subject_name (_certificate); assert (n); @@ -126,6 +132,8 @@ Certificate::subject () const string Certificate::serial () const { + assert (_certificate); + ASN1_INTEGER* s = X509_get_serialNumber (_certificate); assert (s); @@ -142,6 +150,8 @@ Certificate::serial () const string Certificate::thumbprint () const { + assert (_certificate); + uint8_t buffer[8192]; uint8_t* p = buffer; i2d_X509_CINF (_certificate->cert_info, &p); |
