summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s23_lib.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libssl/s23_lib.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libssl/s23_lib.c')
-rw-r--r--src/lib/libssl/s23_lib.c52
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
64static int ssl23_num_ciphers(void ); 63static int ssl23_num_ciphers(void );
65static SSL_CIPHER *ssl23_get_cipher(unsigned int u); 64static SSL_CIPHER *ssl23_get_cipher(unsigned int u);
66static int ssl23_read(SSL *s, char *buf, int len); 65static int ssl23_read(SSL *s, void *buf, int len);
67static int ssl23_write(SSL *s, char *buf, int len); 66static int ssl23_write(SSL *s, const void *buf, int len);
68static long ssl23_default_timeout(void ); 67static long ssl23_default_timeout(void );
69static int ssl23_put_cipher_by_char(SSL_CIPHER *c, unsigned char *p); 68static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p);
70static SSL_CIPHER *ssl23_get_cipher_by_char(unsigned char *p); 69static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p);
71#else 70char *SSL23_version_str="SSLv2/3 compatibility" OPENSSL_VERSION_PTEXT;
72static int ssl23_num_ciphers();
73static SSL_CIPHER *ssl23_get_cipher();
74static int ssl23_read();
75static int ssl23_write();
76static long ssl23_default_timeout();
77static int ssl23_put_cipher_by_char();
78static SSL_CIPHER *ssl23_get_cipher_by_char();
79#endif
80
81char *SSL23_version_str="SSLv2/3 compatablity part of SSLeay 0.7.0 30-Jan-1997";
82 71
83static SSL_METHOD SSLv23_data= { 72static 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
107static long ssl23_default_timeout() 97static long ssl23_default_timeout(void)
108 { 98 {
109 return(300); 99 return(300);
110 } 100 }
111 101
112SSL_METHOD *sslv23_base_method() 102SSL_METHOD *sslv23_base_method(void)
113 { 103 {
114 return(&SSLv23_data); 104 return(&SSLv23_data);
115 } 105 }
116 106
117static int ssl23_num_ciphers() 107static 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
122static SSL_CIPHER *ssl23_get_cipher(u) 112static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
123unsigned 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 */
135static SSL_CIPHER *ssl23_get_cipher_by_char(p) 124static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
136unsigned 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
152static int ssl23_put_cipher_by_char(c,p) 140static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
153SSL_CIPHER *c;
154unsigned 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
169static int ssl23_read(s,buf,len) 155static int ssl23_read(SSL *s, void *buf, int len)
170SSL *s;
171char *buf;
172int len;
173 { 156 {
174 int n; 157 int n;
175 158
@@ -199,10 +182,7 @@ int len;
199 } 182 }
200 } 183 }
201 184
202static int ssl23_write(s,buf,len) 185static int ssl23_write(SSL *s, const void *buf, int len)
203SSL *s;
204char *buf;
205int len;
206 { 186 {
207 int n; 187 int n;
208 188