diff options
| author | djm <> | 2008-09-06 12:15:56 +0000 |
|---|---|---|
| committer | djm <> | 2008-09-06 12:15:56 +0000 |
| commit | 5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80 (patch) | |
| tree | aba68249883aa9d2361d92eef69a81d0c4961732 /src/lib/libssl/s23_lib.c | |
| parent | f6198d4d0ab97685dc56be2d48715ed39fcc74b9 (diff) | |
| download | openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.gz openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.bz2 openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.zip | |
import of OpenSSL 0.9.8h
Diffstat (limited to 'src/lib/libssl/s23_lib.c')
| -rw-r--r-- | src/lib/libssl/s23_lib.c | 62 |
1 files changed, 12 insertions, 50 deletions
diff --git a/src/lib/libssl/s23_lib.c b/src/lib/libssl/s23_lib.c index 8d7dbcf569..fc2981308d 100644 --- a/src/lib/libssl/s23_lib.c +++ b/src/lib/libssl/s23_lib.c | |||
| @@ -60,55 +60,17 @@ | |||
| 60 | #include <openssl/objects.h> | 60 | #include <openssl/objects.h> |
| 61 | #include "ssl_locl.h" | 61 | #include "ssl_locl.h" |
| 62 | 62 | ||
| 63 | static int ssl23_num_ciphers(void ); | 63 | long ssl23_default_timeout(void) |
| 64 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u); | ||
| 65 | static int ssl23_read(SSL *s, void *buf, int len); | ||
| 66 | static int ssl23_peek(SSL *s, void *buf, int len); | ||
| 67 | static int ssl23_write(SSL *s, const void *buf, int len); | ||
| 68 | static long ssl23_default_timeout(void ); | ||
| 69 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); | ||
| 70 | static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p); | ||
| 71 | const char *SSL23_version_str="SSLv2/3 compatibility" OPENSSL_VERSION_PTEXT; | ||
| 72 | |||
| 73 | static SSL_METHOD SSLv23_data= { | ||
| 74 | TLS1_VERSION, | ||
| 75 | tls1_new, | ||
| 76 | tls1_clear, | ||
| 77 | tls1_free, | ||
| 78 | ssl_undefined_function, | ||
| 79 | ssl_undefined_function, | ||
| 80 | ssl23_read, | ||
| 81 | ssl23_peek, | ||
| 82 | ssl23_write, | ||
| 83 | ssl_undefined_function, | ||
| 84 | ssl_undefined_function, | ||
| 85 | ssl_ok, | ||
| 86 | ssl3_ctrl, | ||
| 87 | ssl3_ctx_ctrl, | ||
| 88 | ssl23_get_cipher_by_char, | ||
| 89 | ssl23_put_cipher_by_char, | ||
| 90 | ssl_undefined_const_function, | ||
| 91 | ssl23_num_ciphers, | ||
| 92 | ssl23_get_cipher, | ||
| 93 | ssl_bad_method, | ||
| 94 | ssl23_default_timeout, | ||
| 95 | &ssl3_undef_enc_method, | ||
| 96 | ssl_undefined_function, | ||
| 97 | ssl3_callback_ctrl, | ||
| 98 | ssl3_ctx_callback_ctrl, | ||
| 99 | }; | ||
| 100 | |||
| 101 | static long ssl23_default_timeout(void) | ||
| 102 | { | 64 | { |
| 103 | return(300); | 65 | return(300); |
| 104 | } | 66 | } |
| 105 | 67 | ||
| 106 | SSL_METHOD *sslv23_base_method(void) | 68 | IMPLEMENT_ssl23_meth_func(sslv23_base_method, |
| 107 | { | 69 | ssl_undefined_function, |
| 108 | return(&SSLv23_data); | 70 | ssl_undefined_function, |
| 109 | } | 71 | ssl_bad_method) |
| 110 | 72 | ||
| 111 | static int ssl23_num_ciphers(void) | 73 | int ssl23_num_ciphers(void) |
| 112 | { | 74 | { |
| 113 | return(ssl3_num_ciphers() | 75 | return(ssl3_num_ciphers() |
| 114 | #ifndef OPENSSL_NO_SSL2 | 76 | #ifndef OPENSSL_NO_SSL2 |
| @@ -117,7 +79,7 @@ static int ssl23_num_ciphers(void) | |||
| 117 | ); | 79 | ); |
| 118 | } | 80 | } |
| 119 | 81 | ||
| 120 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u) | 82 | SSL_CIPHER *ssl23_get_cipher(unsigned int u) |
| 121 | { | 83 | { |
| 122 | unsigned int uu=ssl3_num_ciphers(); | 84 | unsigned int uu=ssl3_num_ciphers(); |
| 123 | 85 | ||
| @@ -133,7 +95,7 @@ static SSL_CIPHER *ssl23_get_cipher(unsigned int u) | |||
| 133 | 95 | ||
| 134 | /* This function needs to check if the ciphers required are actually | 96 | /* This function needs to check if the ciphers required are actually |
| 135 | * available */ | 97 | * available */ |
| 136 | static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) | 98 | SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) |
| 137 | { | 99 | { |
| 138 | SSL_CIPHER c,*cp; | 100 | SSL_CIPHER c,*cp; |
| 139 | unsigned long id; | 101 | unsigned long id; |
| @@ -151,7 +113,7 @@ static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) | |||
| 151 | return(cp); | 113 | return(cp); |
| 152 | } | 114 | } |
| 153 | 115 | ||
| 154 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) | 116 | int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) |
| 155 | { | 117 | { |
| 156 | long l; | 118 | long l; |
| 157 | 119 | ||
| @@ -166,7 +128,7 @@ static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) | |||
| 166 | return(3); | 128 | return(3); |
| 167 | } | 129 | } |
| 168 | 130 | ||
| 169 | static int ssl23_read(SSL *s, void *buf, int len) | 131 | int ssl23_read(SSL *s, void *buf, int len) |
| 170 | { | 132 | { |
| 171 | int n; | 133 | int n; |
| 172 | 134 | ||
| @@ -189,7 +151,7 @@ static int ssl23_read(SSL *s, void *buf, int len) | |||
| 189 | } | 151 | } |
| 190 | } | 152 | } |
| 191 | 153 | ||
| 192 | static int ssl23_peek(SSL *s, void *buf, int len) | 154 | int ssl23_peek(SSL *s, void *buf, int len) |
| 193 | { | 155 | { |
| 194 | int n; | 156 | int n; |
| 195 | 157 | ||
| @@ -212,7 +174,7 @@ static int ssl23_peek(SSL *s, void *buf, int len) | |||
| 212 | } | 174 | } |
| 213 | } | 175 | } |
| 214 | 176 | ||
| 215 | static int ssl23_write(SSL *s, const void *buf, int len) | 177 | int ssl23_write(SSL *s, const void *buf, int len) |
| 216 | { | 178 | { |
| 217 | int n; | 179 | int n; |
| 218 | 180 | ||
