提交 377dcdba 编写于 作者: R Richard Levitte

Add functionality to get information on compression methods (not quite complete).

上级 82423549
...@@ -1198,6 +1198,10 @@ int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits); ...@@ -1198,6 +1198,10 @@ int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits);
char * SSL_CIPHER_get_version(SSL_CIPHER *c); char * SSL_CIPHER_get_version(SSL_CIPHER *c);
const char * SSL_CIPHER_get_name(SSL_CIPHER *c); const char * SSL_CIPHER_get_name(SSL_CIPHER *c);
const COMP_METHOD *SSL_get_current_compression(SSL *s);
const COMP_METHOD *SSL_get_current_expansion(SSL *s);
const char *SSL_COMP_get_name(const COMP_METHOD *comp);
int SSL_get_fd(SSL *s); int SSL_get_fd(SSL *s);
int SSL_get_rfd(SSL *s); int SSL_get_rfd(SSL *s);
int SSL_get_wfd(SSL *s); int SSL_get_wfd(SSL *s);
......
...@@ -108,6 +108,12 @@ int SSL_library_init(void) ...@@ -108,6 +108,12 @@ int SSL_library_init(void)
#if 0 #if 0
EVP_add_digest(EVP_sha()); EVP_add_digest(EVP_sha());
EVP_add_digest(EVP_dss()); EVP_add_digest(EVP_dss());
#endif
#ifndef OPENSSL_NO_COMP
/* This will initialise the built-in compression algorithms.
The value returned is a STACK_OF(SSL_COMP), but that can
be discarded safely */
(void)SSL_COMP_get_compression_methods();
#endif #endif
return(1); return(1);
} }
......
...@@ -1204,3 +1204,11 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) ...@@ -1204,3 +1204,11 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
return(0); return(0);
} }
} }
const char *SSL_COMP_get_name(const COMP_METHOD *comp)
{
if (comp)
return comp->name;
return NULL;
}
...@@ -2207,6 +2207,20 @@ SSL_CIPHER *SSL_get_current_cipher(SSL *s) ...@@ -2207,6 +2207,20 @@ SSL_CIPHER *SSL_get_current_cipher(SSL *s)
return(NULL); return(NULL);
} }
const COMP_METHOD *SSL_get_current_compression(SSL *s)
{
if (s->compress != NULL)
return(s->compress->meth);
return(NULL);
}
const COMP_METHOD *SSL_get_current_expansion(SSL *s)
{
if (s->expand != NULL)
return(s->expand->meth);
return(NULL);
}
int ssl_init_wbio_buffer(SSL *s,int push) int ssl_init_wbio_buffer(SSL *s,int push)
{ {
BIO *bbio; BIO *bbio;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册