diff options
Diffstat (limited to 'src/lib/libssl/s23_lib.c')
-rw-r--r-- | src/lib/libssl/s23_lib.c | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/src/lib/libssl/s23_lib.c b/src/lib/libssl/s23_lib.c index e16f641101..822a395837 100644 --- a/src/lib/libssl/s23_lib.c +++ b/src/lib/libssl/s23_lib.c | |||
@@ -57,28 +57,17 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "objects.h" | 60 | #include <openssl/objects.h> |
61 | #include "ssl_locl.h" | 61 | #include "ssl_locl.h" |
62 | 62 | ||
63 | #ifndef NOPROTO | ||
64 | static int ssl23_num_ciphers(void ); | 63 | static int ssl23_num_ciphers(void ); |
65 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u); | 64 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u); |
66 | static int ssl23_read(SSL *s, char *buf, int len); | 65 | static int ssl23_read(SSL *s, void *buf, int len); |
67 | static int ssl23_write(SSL *s, char *buf, int len); | 66 | static int ssl23_write(SSL *s, const void *buf, int len); |
68 | static long ssl23_default_timeout(void ); | 67 | static long ssl23_default_timeout(void ); |
69 | static int ssl23_put_cipher_by_char(SSL_CIPHER *c, unsigned char *p); | 68 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); |
70 | static SSL_CIPHER *ssl23_get_cipher_by_char(unsigned char *p); | 69 | static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p); |
71 | #else | 70 | char *SSL23_version_str="SSLv2/3 compatibility" OPENSSL_VERSION_PTEXT; |
72 | static int ssl23_num_ciphers(); | ||
73 | static SSL_CIPHER *ssl23_get_cipher(); | ||
74 | static int ssl23_read(); | ||
75 | static int ssl23_write(); | ||
76 | static long ssl23_default_timeout(); | ||
77 | static int ssl23_put_cipher_by_char(); | ||
78 | static SSL_CIPHER *ssl23_get_cipher_by_char(); | ||
79 | #endif | ||
80 | |||
81 | char *SSL23_version_str="SSLv2/3 compatablity part of SSLeay 0.7.0 30-Jan-1997"; | ||
82 | 71 | ||
83 | static SSL_METHOD SSLv23_data= { | 72 | static SSL_METHOD SSLv23_data= { |
84 | TLS1_VERSION, | 73 | TLS1_VERSION, |
@@ -88,10 +77,11 @@ static SSL_METHOD SSLv23_data= { | |||
88 | ssl_undefined_function, | 77 | ssl_undefined_function, |
89 | ssl_undefined_function, | 78 | ssl_undefined_function, |
90 | ssl23_read, | 79 | ssl23_read, |
91 | ssl_undefined_function, | 80 | (int (*)(struct ssl_st *, char *, int))ssl_undefined_function, |
92 | ssl23_write, | 81 | ssl23_write, |
93 | ssl_undefined_function, | 82 | ssl_undefined_function, |
94 | ssl_undefined_function, | 83 | ssl_undefined_function, |
84 | ssl_ok, | ||
95 | ssl3_ctrl, | 85 | ssl3_ctrl, |
96 | ssl3_ctx_ctrl, | 86 | ssl3_ctx_ctrl, |
97 | ssl23_get_cipher_by_char, | 87 | ssl23_get_cipher_by_char, |
@@ -104,23 +94,22 @@ static SSL_METHOD SSLv23_data= { | |||
104 | &ssl3_undef_enc_method, | 94 | &ssl3_undef_enc_method, |
105 | }; | 95 | }; |
106 | 96 | ||
107 | static long ssl23_default_timeout() | 97 | static long ssl23_default_timeout(void) |
108 | { | 98 | { |
109 | return(300); | 99 | return(300); |
110 | } | 100 | } |
111 | 101 | ||
112 | SSL_METHOD *sslv23_base_method() | 102 | SSL_METHOD *sslv23_base_method(void) |
113 | { | 103 | { |
114 | return(&SSLv23_data); | 104 | return(&SSLv23_data); |
115 | } | 105 | } |
116 | 106 | ||
117 | static int ssl23_num_ciphers() | 107 | static int ssl23_num_ciphers(void) |
118 | { | 108 | { |
119 | return(ssl3_num_ciphers()+ssl2_num_ciphers()); | 109 | return(ssl3_num_ciphers()+ssl2_num_ciphers()); |
120 | } | 110 | } |
121 | 111 | ||
122 | static SSL_CIPHER *ssl23_get_cipher(u) | 112 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u) |
123 | unsigned int u; | ||
124 | { | 113 | { |
125 | unsigned int uu=ssl3_num_ciphers(); | 114 | unsigned int uu=ssl3_num_ciphers(); |
126 | 115 | ||
@@ -132,8 +121,7 @@ unsigned int u; | |||
132 | 121 | ||
133 | /* This function needs to check if the ciphers required are actually | 122 | /* This function needs to check if the ciphers required are actually |
134 | * available */ | 123 | * available */ |
135 | static SSL_CIPHER *ssl23_get_cipher_by_char(p) | 124 | static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) |
136 | unsigned char *p; | ||
137 | { | 125 | { |
138 | SSL_CIPHER c,*cp; | 126 | SSL_CIPHER c,*cp; |
139 | unsigned long id; | 127 | unsigned long id; |
@@ -149,9 +137,7 @@ unsigned char *p; | |||
149 | return(cp); | 137 | return(cp); |
150 | } | 138 | } |
151 | 139 | ||
152 | static int ssl23_put_cipher_by_char(c,p) | 140 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) |
153 | SSL_CIPHER *c; | ||
154 | unsigned char *p; | ||
155 | { | 141 | { |
156 | long l; | 142 | long l; |
157 | 143 | ||
@@ -166,10 +152,7 @@ unsigned char *p; | |||
166 | return(3); | 152 | return(3); |
167 | } | 153 | } |
168 | 154 | ||
169 | static int ssl23_read(s,buf,len) | 155 | static int ssl23_read(SSL *s, void *buf, int len) |
170 | SSL *s; | ||
171 | char *buf; | ||
172 | int len; | ||
173 | { | 156 | { |
174 | int n; | 157 | int n; |
175 | 158 | ||
@@ -199,10 +182,7 @@ int len; | |||
199 | } | 182 | } |
200 | } | 183 | } |
201 | 184 | ||
202 | static int ssl23_write(s,buf,len) | 185 | static int ssl23_write(SSL *s, const void *buf, int len) |
203 | SSL *s; | ||
204 | char *buf; | ||
205 | int len; | ||
206 | { | 186 | { |
207 | int n; | 187 | int n; |
208 | 188 | ||