| 111 | }; |
| 112 | |
| 113 | bool |
| 114 | SslHdrExpandX509Field(BIO *bio, X509 *x509, ExpansionField field) |
| 115 | { |
| 116 | // Rewind the BIO. |
| 117 | (void)BIO_reset(bio); |
| 118 | |
| 119 | if (field < expansions.size()) { |
| 120 | expansions[field](x509, bio); |
| 121 | } |
| 122 | |
| 123 | #if 0 |
| 124 | if (BIO_pending(bio)) { |
| 125 | long len; |
| 126 | char * ptr; |
| 127 | len = BIO_get_mem_data(bio, &ptr); |
| 128 | SslHdrDebug("X509 field %d: %.*s", (int)field, (int)len, ptr); |
| 129 | } |
| 130 | #endif |
| 131 | |
| 132 | return true; |
| 133 | } |