| 591 | } |
| 592 | |
| 593 | apr_status_t modssl_cert_get_pem(apr_pool_t *p, |
| 594 | X509 *cert1, X509 *cert2, |
| 595 | const char **ppem) |
| 596 | { |
| 597 | apr_status_t rv = APR_ENOMEM; |
| 598 | BIO *bio; |
| 599 | |
| 600 | if ((bio = BIO_new(BIO_s_mem())) == NULL) goto cleanup; |
| 601 | if (PEM_write_bio_X509(bio, cert1) != 1) goto cleanup; |
| 602 | if (cert2 && PEM_write_bio_X509(bio, cert2) != 1) goto cleanup; |
| 603 | rv = APR_SUCCESS; |
| 604 | |
| 605 | cleanup: |
| 606 | if (rv != APR_SUCCESS) { |
| 607 | *ppem = NULL; |
| 608 | if (bio) BIO_free(bio); |
| 609 | } |
| 610 | else { |
| 611 | *ppem = modssl_bio_free_read(p, bio); |
| 612 | } |
| 613 | return rv; |
| 614 | } |
| 615 | |
| 616 | void modssl_set_reneg_state(SSLConnRec *sslconn, modssl_reneg_state state) |
| 617 | { |
no test coverage detected