diff options
| author | beck <> | 1999-09-29 04:37:45 +0000 |
|---|---|---|
| committer | beck <> | 1999-09-29 04:37:45 +0000 |
| commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
| tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libssl/ssl_txt.c | |
| parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
| download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip | |
OpenSSL 0.9.4 merge
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/ssl_txt.c | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/src/lib/libssl/ssl_txt.c b/src/lib/libssl/ssl_txt.c index ce60e1a6dd..ca67a98d89 100644 --- a/src/lib/libssl/ssl_txt.c +++ b/src/lib/libssl/ssl_txt.c | |||
| @@ -57,34 +57,30 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "buffer.h" | 60 | #include <openssl/buffer.h> |
| 61 | #include "ssl_locl.h" | 61 | #include "ssl_locl.h" |
| 62 | 62 | ||
| 63 | #ifndef NO_FP_API | 63 | #ifndef NO_FP_API |
| 64 | int SSL_SESSION_print_fp(fp, x) | 64 | int SSL_SESSION_print_fp(FILE *fp, SSL_SESSION *x) |
| 65 | FILE *fp; | 65 | { |
| 66 | SSL_SESSION *x; | 66 | BIO *b; |
| 67 | { | 67 | int ret; |
| 68 | BIO *b; | ||
| 69 | int ret; | ||
| 70 | 68 | ||
| 71 | if ((b=BIO_new(BIO_s_file_internal())) == NULL) | 69 | if ((b=BIO_new(BIO_s_file_internal())) == NULL) |
| 72 | { | 70 | { |
| 73 | SSLerr(SSL_F_SSL_SESSION_PRINT_FP,ERR_R_BUF_LIB); | 71 | SSLerr(SSL_F_SSL_SESSION_PRINT_FP,ERR_R_BUF_LIB); |
| 74 | return(0); | 72 | return(0); |
| 75 | } | 73 | } |
| 76 | BIO_set_fp(b,fp,BIO_NOCLOSE); | 74 | BIO_set_fp(b,fp,BIO_NOCLOSE); |
| 77 | ret=SSL_SESSION_print(b,x); | 75 | ret=SSL_SESSION_print(b,x); |
| 78 | BIO_free(b); | 76 | BIO_free(b); |
| 79 | return(ret); | 77 | return(ret); |
| 80 | } | 78 | } |
| 81 | #endif | 79 | #endif |
| 82 | 80 | ||
| 83 | int SSL_SESSION_print(bp,x) | 81 | int SSL_SESSION_print(BIO *bp, SSL_SESSION *x) |
| 84 | BIO *bp; | ||
| 85 | SSL_SESSION *x; | ||
| 86 | { | 82 | { |
| 87 | int i; | 83 | unsigned int i; |
| 88 | char str[128],*s; | 84 | char str[128],*s; |
| 89 | 85 | ||
| 90 | if (x == NULL) goto err; | 86 | if (x == NULL) goto err; |
| @@ -111,13 +107,19 @@ SSL_SESSION *x; | |||
| 111 | sprintf(str," Cipher : %s\n",(x->cipher == NULL)?"unknown":x->cipher->name); | 107 | sprintf(str," Cipher : %s\n",(x->cipher == NULL)?"unknown":x->cipher->name); |
| 112 | if (BIO_puts(bp,str) <= 0) goto err; | 108 | if (BIO_puts(bp,str) <= 0) goto err; |
| 113 | if (BIO_puts(bp," Session-ID: ") <= 0) goto err; | 109 | if (BIO_puts(bp," Session-ID: ") <= 0) goto err; |
| 114 | for (i=0; i<(int)x->session_id_length; i++) | 110 | for (i=0; i<x->session_id_length; i++) |
| 115 | { | 111 | { |
| 116 | sprintf(str,"%02X",x->session_id[i]); | 112 | sprintf(str,"%02X",x->session_id[i]); |
| 117 | if (BIO_puts(bp,str) <= 0) goto err; | 113 | if (BIO_puts(bp,str) <= 0) goto err; |
| 118 | } | 114 | } |
| 115 | if (BIO_puts(bp,"\nSession-ID-ctx: ") <= 0) goto err; | ||
| 116 | for (i=0; i<x->sid_ctx_length; i++) | ||
| 117 | { | ||
| 118 | sprintf(str,"%02X",x->sid_ctx[i]); | ||
| 119 | if (BIO_puts(bp,str) <= 0) goto err; | ||
| 120 | } | ||
| 119 | if (BIO_puts(bp,"\n Master-Key: ") <= 0) goto err; | 121 | if (BIO_puts(bp,"\n Master-Key: ") <= 0) goto err; |
| 120 | for (i=0; i<(int)x->master_key_length; i++) | 122 | for (i=0; i<(unsigned int)x->master_key_length; i++) |
| 121 | { | 123 | { |
| 122 | sprintf(str,"%02X",x->master_key[i]); | 124 | sprintf(str,"%02X",x->master_key[i]); |
| 123 | if (BIO_puts(bp,str) <= 0) goto err; | 125 | if (BIO_puts(bp,str) <= 0) goto err; |
| @@ -128,11 +130,28 @@ SSL_SESSION *x; | |||
| 128 | if (BIO_puts(bp,"None") <= 0) goto err; | 130 | if (BIO_puts(bp,"None") <= 0) goto err; |
| 129 | } | 131 | } |
| 130 | else | 132 | else |
| 131 | for (i=0; i<(int)x->key_arg_length; i++) | 133 | for (i=0; i<x->key_arg_length; i++) |
| 132 | { | 134 | { |
| 133 | sprintf(str,"%02X",x->key_arg[i]); | 135 | sprintf(str,"%02X",x->key_arg[i]); |
| 134 | if (BIO_puts(bp,str) <= 0) goto err; | 136 | if (BIO_puts(bp,str) <= 0) goto err; |
| 135 | } | 137 | } |
| 138 | if (x->compress_meth != 0) | ||
| 139 | { | ||
| 140 | SSL_COMP *comp; | ||
| 141 | |||
| 142 | ssl_cipher_get_evp(x,NULL,NULL,&comp); | ||
| 143 | if (comp == NULL) | ||
| 144 | { | ||
| 145 | sprintf(str,"\n Compression: %d",x->compress_meth); | ||
| 146 | if (BIO_puts(bp,str) <= 0) goto err; | ||
| 147 | } | ||
| 148 | else | ||
| 149 | { | ||
| 150 | sprintf(str,"\n Compression: %d (%s)", | ||
| 151 | comp->id,comp->method->name); | ||
| 152 | if (BIO_puts(bp,str) <= 0) goto err; | ||
| 153 | } | ||
| 154 | } | ||
| 136 | if (x->time != 0L) | 155 | if (x->time != 0L) |
| 137 | { | 156 | { |
| 138 | sprintf(str,"\n Start Time: %ld",x->time); | 157 | sprintf(str,"\n Start Time: %ld",x->time); |
