* Formats an ASN1_TIME object as a human-readable string. * * @param t The ASN1_TIME object to format. * * @returns A string representation of the ASN1_TIME object. */
| 108 | * @returns A string representation of the ASN1_TIME object. |
| 109 | */ |
| 110 | static std::string FormatAsn1Time(const ASN1_TIME* t) |
| 111 | { |
| 112 | std::shared_ptr<BIO> bio(BIO_new(BIO_s_mem()), BIO_free); |
| 113 | BOOST_REQUIRE_MESSAGE(bio, "BIO_new(BIO_s_mem()): " << GetOpenSSLError()); |
| 114 | ASN1_TIME_print(bio.get(), t); |
| 115 | char *data; |
| 116 | long len = BIO_get_mem_data(bio.get(), &data); |
| 117 | std::string result(data, data + len); |
| 118 | return result; |
| 119 | } |
| 120 | |
| 121 | // Asserts that verifying the given leaf certificate against the given CA certificate results in a certificate |
| 122 | // expiration error. This macro is used so that when the assertion fails, the test output refers to the exact |
no test coverage detected