| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | | - |
| 30 | | - |
| 31 | | - |
| 32 | | - |
| 33 | | - |
| 34 | | - |
| 35 | | - |
| 36 | | - |
| 37 | | - |
| 38 | | - |
| 39 | | - |
| 40 | | - |
| 41 | | - |
| 42 | | - |
| 43 | | - |
| 44 | | - |
| 45 | | - |
| 46 | | - |
| 47 | | - |
| 48 | | - |
| 49 | | - |
| 50 | | - |
| 51 | | - |
| 52 | | - |
| 53 | | - |
| 54 | | - |
| 55 | | - |
| 56 | | - |
| 57 | | - |
| 58 | | - |
| 59 | | - |
| 60 | | - |
| 61 | | - |
| 62 | | - |
| 63 | | - |
| 64 | | - |
| 65 | | - |
| 66 | | - |
| 67 | | - |
| 68 | | - |
| 69 | | - |
| 70 | | - |
| 71 | | - |
| 72 | | - |
| 73 | | - |
| 74 | | - |
| 75 | | - |
| 76 | | - |
| 77 | | - |
| 78 | | - |
| 79 | | - |
| 80 | | - |
| 81 | | - |
| 82 | | - |
| 83 | | - |
| 84 | | - |
| 85 | #include <inttypes.h> | - |
| 86 | #include <stdio.h> | - |
| 87 | | - |
| 88 | #include <openssl/buffer.h> | - |
| 89 | | - |
| 90 | #include "ssl_locl.h" | - |
| 91 | | - |
| 92 | int | - |
| 93 | SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *x) | - |
| 94 | { | - |
| 95 | BIO *b; | - |
| 96 | int ret; | - |
| 97 | | - |
| 98 | if ((b = BIO_new(BIO_s_file_internal())) == NULL) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 99 | SSLerrorx(ERR_R_BUF_LIB); | - |
| 100 | return (0); never executed: return (0); | 0 |
| 101 | } | - |
| 102 | BIO_set_fp(b, fp, BIO_NOCLOSE); | - |
| 103 | ret = SSL_SESSION_print(b, x); | - |
| 104 | BIO_free(b); | - |
| 105 | return (ret); never executed: return (ret); | 0 |
| 106 | } | - |
| 107 | | - |
| 108 | int | - |
| 109 | SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) | - |
| 110 | { | - |
| 111 | unsigned int i; | - |
| 112 | const char *s; | - |
| 113 | | - |
| 114 | if (x == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 115 | goto err; never executed: goto err; | 0 |
| 116 | if (BIO_puts(bp, "SSL-Session:\n") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 117 | goto err; never executed: goto err; | 0 |
| 118 | | - |
| 119 | s = ssl_version_string(x->ssl_version); | - |
| 120 | if (BIO_printf(bp, " Protocol : %s\n", s) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 121 | goto err; never executed: goto err; | 0 |
| 122 | | - |
| 123 | if (x->cipher == NULL) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 124 | if (((x->cipher_id) & 0xff000000) == 0x02000000) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 125 | if (BIO_printf(bp, " Cipher : %06lX\n", x->cipher_id&0xffffff) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 126 | goto err; never executed: goto err; | 0 |
| 127 | } else { never executed: end of block | 0 |
| 128 | if (BIO_printf(bp, " Cipher : %04lX\n", x->cipher_id&0xffff) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 129 | goto err; never executed: goto err; | 0 |
| 130 | } never executed: end of block | 0 |
| 131 | } else { | - |
| 132 | if (BIO_printf(bp, " Cipher : %s\n",((x->cipher == NULL)?"unknown":x->cipher->name)) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 133 | goto err; never executed: goto err; | 0 |
| 134 | } never executed: end of block | 0 |
| 135 | if (BIO_puts(bp, " Session-ID: ") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 136 | goto err; never executed: goto err; | 0 |
| 137 | for (i = 0; i < x->session_id_length; i++) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 138 | if (BIO_printf(bp, "%02X", x->session_id[i]) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 139 | goto err; never executed: goto err; | 0 |
| 140 | } never executed: end of block | 0 |
| 141 | if (BIO_puts(bp, "\n Session-ID-ctx: ") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 142 | goto err; never executed: goto err; | 0 |
| 143 | for (i = 0; i < x->sid_ctx_length; i++) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 144 | if (BIO_printf(bp, "%02X", x->sid_ctx[i]) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 145 | goto err; never executed: goto err; | 0 |
| 146 | } never executed: end of block | 0 |
| 147 | if (BIO_puts(bp, "\n Master-Key: ") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 148 | goto err; never executed: goto err; | 0 |
| 149 | for (i = 0; i < (unsigned int)x->master_key_length; i++) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 150 | if (BIO_printf(bp, "%02X", x->master_key[i]) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 151 | goto err; never executed: goto err; | 0 |
| 152 | } never executed: end of block | 0 |
| 153 | if (x->tlsext_tick_lifetime_hint) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 154 | if (BIO_printf(bp,| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 155 | "\n TLS session ticket lifetime hint: %ld (seconds)",| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 156 | x->tlsext_tick_lifetime_hint) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 157 | goto err; never executed: goto err; | 0 |
| 158 | } never executed: end of block | 0 |
| 159 | if (x->tlsext_tick) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 160 | if (BIO_puts(bp, "\n TLS session ticket:\n") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 161 | goto err; never executed: goto err; | 0 |
| 162 | if (BIO_dump_indent(bp, (char *)x->tlsext_tick, x->tlsext_ticklen, 4) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 163 | goto err; never executed: goto err; | 0 |
| 164 | } never executed: end of block | 0 |
| 165 | | - |
| 166 | if (x->time != 0) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 167 | if (BIO_printf(bp, "\n Start Time: %"PRId64, (int64_t)x->time) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 168 | goto err; never executed: goto err; | 0 |
| 169 | } never executed: end of block | 0 |
| 170 | if (x->timeout != 0L) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 171 | if (BIO_printf(bp, "\n Timeout : %ld (sec)", x->timeout) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 172 | goto err; never executed: goto err; | 0 |
| 173 | } never executed: end of block | 0 |
| 174 | if (BIO_puts(bp, "\n") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 175 | goto err; never executed: goto err; | 0 |
| 176 | | - |
| 177 | if (BIO_puts(bp, " Verify return code: ") <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 178 | goto err; never executed: goto err; | 0 |
| 179 | | - |
| 180 | if (BIO_printf(bp, "%ld (%s)\n", x->verify_result,| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 181 | X509_verify_cert_error_string(x->verify_result)) <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 182 | goto err; never executed: goto err; | 0 |
| 183 | | - |
| 184 | return (1); never executed: return (1); | 0 |
| 185 | err: | - |
| 186 | return (0); never executed: return (0); | 0 |
| 187 | } | - |
| 188 | | - |
| | |