summaryrefslogtreecommitdiffstats
path: root/ssl/ssltest.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-10-06 11:00:15 +0000
committerRichard Levitte <levitte@openssl.org>2003-10-06 11:00:15 +0000
commit8242354952ead170335b98b33254ca9a0e836926 (patch)
tree0a87cad1acecb32f22dd045d240154c1cfcb4b42 /ssl/ssltest.c
parentc40b9bdefb59be7e640cd7a10bfd2fa26ea1fe7b (diff)
Make sure int SSL_COMP_add_compression_method() checks if a certain
compression identity is already present among the registered compression methods, and if so, reject the addition request. Declare SSL_COMP_get_compression_method() so it can be used properly. Change ssltest.c so it checks what compression methods are available and enumerates them. As a side-effect, built-in compression methods will be automagically loaded that way. Additionally, change the identities for ZLIB and RLE to be conformant to draft-ietf-tls-compression-05.txt. Finally, make update. Next on my list: have the built-in compression methods added "automatically" instead of requiring that the author call SSL_COMP_add_compression_method() or SSL_COMP_get_compression_methods().
Diffstat (limited to 'ssl/ssltest.c')
-rw-r--r--ssl/ssltest.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 0c684604c7..6391cf207b 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -164,8 +164,8 @@
/* There is really no standard for this, so let's assign some tentative
numbers. In any case, these numbers are only for this test */
-#define COMP_RLE 1
-#define COMP_ZLIB 2
+#define COMP_RLE 255
+#define COMP_ZLIB 1
static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
#ifndef OPENSSL_NO_RSA
@@ -373,7 +373,7 @@ int main(int argc, char *argv[])
SSL_METHOD *meth=NULL;
SSL *c_ssl,*s_ssl;
int number=1,reuse=0;
- long bytes=1L;
+ long bytes=256L;
#ifndef OPENSSL_NO_DH
DH *dh;
int dhe1024 = 0, dhe1024dsa = 0;
@@ -387,6 +387,7 @@ int main(int argc, char *argv[])
clock_t s_time = 0, c_time = 0;
int comp = 0;
COMP_METHOD *cm = NULL;
+ STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
verbose = 0;
debug = 0;
@@ -612,6 +613,19 @@ bad:
ERR_print_errors_fp(stderr);
}
}
+ ssl_comp_methods = SSL_COMP_get_compression_methods();
+ fprintf(stderr, "Available compression methods:\n");
+ {
+ int i, n = sk_SSL_COMP_num(ssl_comp_methods);
+ if (n == 0)
+ fprintf(stderr, " NONE\n");
+ else
+ for (i = 0; i < n; i++)
+ {
+ SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, i);
+ fprintf(stderr, " %d: %s\n", c->id, c->name);
+ }
+ }
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
if (ssl2)