| 522 | } |
| 523 | |
| 524 | static const char *certid_summary(const OCSP_CERTID *certid, apr_pool_t *p) |
| 525 | { |
| 526 | const char *serial, *issuer, *key, *s; |
| 527 | ASN1_INTEGER *aserial; |
| 528 | ASN1_OCTET_STRING *aname_hash, *akey_hash; |
| 529 | ASN1_OBJECT *amd_nid; |
| 530 | BIGNUM *bn; |
| 531 | md_data_t data; |
| 532 | |
| 533 | serial = issuer = key = "???"; |
| 534 | OCSP_id_get0_info(&aname_hash, &amd_nid, &akey_hash, &aserial, (OCSP_CERTID*)certid); |
| 535 | if (aname_hash) { |
| 536 | data.len = (apr_size_t)aname_hash->length; |
| 537 | data.data = (const char*)aname_hash->data; |
| 538 | md_data_to_hex(&issuer, 0, p, &data); |
| 539 | } |
| 540 | if (akey_hash) { |
| 541 | data.len = (apr_size_t)akey_hash->length; |
| 542 | data.data = (const char*)akey_hash->data; |
| 543 | md_data_to_hex(&key, 0, p, &data); |
| 544 | } |
| 545 | if (aserial) { |
| 546 | bn = ASN1_INTEGER_to_BN(aserial, NULL); |
| 547 | s = BN_bn2hex(bn); |
| 548 | serial = apr_pstrdup(p, s); |
| 549 | BN_free(bn); |
| 550 | OPENSSL_free((void*)s); |
| 551 | } |
| 552 | return apr_psprintf(p, "certid[der=%s, issuer=%s, key=%s, serial=%s]", |
| 553 | certid_as_hex(certid, p), issuer, key, serial); |
| 554 | } |
| 555 | |
| 556 | static const char *certstatus_string(int status) |
| 557 | { |
no test coverage detected