diff options
author | kris <kris@FreeBSD.org> | 2000-01-14 05:24:08 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-01-14 05:24:08 +0000 |
commit | 728ac765652f2ea1ea6897cc052ffdd6ed23b476 (patch) | |
tree | 26f6dea2b9b83ed71d58737b3e56ea419c704587 /crypto | |
parent | 2196bee6e9ecd81b3a9082420b701d56ff3c3e26 (diff) | |
download | FreeBSD-src-728ac765652f2ea1ea6897cc052ffdd6ed23b476.zip FreeBSD-src-728ac765652f2ea1ea6897cc052ffdd6ed23b476.tar.gz |
Fix breakage when NO_RSA specified.
Reviewed by: Ben Laurie <ben@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/openssl/ssl/s23_clnt.c | 9 | ||||
-rw-r--r-- | crypto/openssl/ssl/s23_lib.c | 14 | ||||
-rw-r--r-- | crypto/openssl/ssl/s23_srvr.c | 9 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_clnt.c | 4 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_enc.c | 5 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_lib.c | 4 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_meth.c | 4 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_pkt.c | 6 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_srvr.c | 4 |
9 files changed, 54 insertions, 5 deletions
diff --git a/crypto/openssl/ssl/s23_clnt.c b/crypto/openssl/ssl/s23_clnt.c index 299d2ae..a5eca37 100644 --- a/crypto/openssl/ssl/s23_clnt.c +++ b/crypto/openssl/ssl/s23_clnt.c @@ -54,6 +54,8 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ #include <stdio.h> @@ -68,8 +70,10 @@ static int ssl23_client_hello(SSL *s); static int ssl23_get_server_hello(SSL *s); static SSL_METHOD *ssl23_get_client_method(int ver) { +#ifndef NO_SSL2 if (ver == SSL2_VERSION) return(SSLv2_client_method()); +#endif if (ver == SSL3_VERSION) return(SSLv3_client_method()); else if (ver == TLS1_VERSION) @@ -320,6 +324,10 @@ static int ssl23_get_server_hello(SSL *s) if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) && (p[5] == 0x00) && (p[6] == 0x02)) { +#ifdef NO_SSL2 + SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); + goto err; +#else /* we are talking sslv2 */ /* we need to clean up the SSLv3 setup and put in the * sslv2 stuff. */ @@ -375,6 +383,7 @@ static int ssl23_get_server_hello(SSL *s) s->method=SSLv2_client_method(); s->handshake_func=s->method->ssl_connect; +#endif } else if ((p[0] == SSL3_RT_HANDSHAKE) && (p[1] == SSL3_VERSION_MAJOR) && diff --git a/crypto/openssl/ssl/s23_lib.c b/crypto/openssl/ssl/s23_lib.c index 822a395..5e029d1 100644 --- a/crypto/openssl/ssl/s23_lib.c +++ b/crypto/openssl/ssl/s23_lib.c @@ -54,6 +54,8 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ #include <stdio.h> @@ -106,7 +108,11 @@ SSL_METHOD *sslv23_base_method(void) static int ssl23_num_ciphers(void) { - return(ssl3_num_ciphers()+ssl2_num_ciphers()); + return(ssl3_num_ciphers() +#ifndef NO_SSL2 + +ssl2_num_ciphers() +#endif + ); } static SSL_CIPHER *ssl23_get_cipher(unsigned int u) @@ -116,7 +122,11 @@ static SSL_CIPHER *ssl23_get_cipher(unsigned int u) if (u < uu) return(ssl3_get_cipher(u)); else +#ifndef NO_SSL2 return(ssl2_get_cipher(u-uu)); +#else + return(NULL); +#endif } /* This function needs to check if the ciphers required are actually @@ -132,8 +142,10 @@ static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) ((unsigned long)p[1]<<8L)|(unsigned long)p[2]; c.id=id; cp=ssl3_get_cipher_by_char(p); +#ifndef NO_SSL2 if (cp == NULL) cp=ssl2_get_cipher_by_char(p); +#endif return(cp); } diff --git a/crypto/openssl/ssl/s23_srvr.c b/crypto/openssl/ssl/s23_srvr.c index e4122f2..b4836c1 100644 --- a/crypto/openssl/ssl/s23_srvr.c +++ b/crypto/openssl/ssl/s23_srvr.c @@ -54,6 +54,8 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ #include <stdio.h> @@ -67,8 +69,10 @@ static SSL_METHOD *ssl23_get_server_method(int ver); int ssl23_get_client_hello(SSL *s); static SSL_METHOD *ssl23_get_server_method(int ver) { +#ifndef NO_SSL2 if (ver == SSL2_VERSION) return(SSLv2_server_method()); +#endif if (ver == SSL3_VERSION) return(SSLv3_server_method()); else if (ver == TLS1_VERSION) @@ -404,6 +408,10 @@ next_bit: if (type == 1) { +#ifdef NO_SSL2 + SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNKNOWN_PROTOCOL); + goto err; +#else /* we are talking sslv2 */ /* we need to clean up the SSLv3/TLSv1 setup and put in the * sslv2 stuff. */ @@ -442,6 +450,7 @@ next_bit: s->method=SSLv2_server_method(); s->handshake_func=s->method->ssl_accept; +#endif } if ((type == 2) || (type == 3)) diff --git a/crypto/openssl/ssl/s2_clnt.c b/crypto/openssl/ssl/s2_clnt.c index 1fe8bd6..74d76be 100644 --- a/crypto/openssl/ssl/s2_clnt.c +++ b/crypto/openssl/ssl/s2_clnt.c @@ -54,9 +54,11 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ -#ifndef NO_RSA +#ifndef NO_SSL2 #include <stdio.h> #include <openssl/rand.h> #include <openssl/buffer.h> diff --git a/crypto/openssl/ssl/s2_enc.c b/crypto/openssl/ssl/s2_enc.c index 0983500..b3b2218 100644 --- a/crypto/openssl/ssl/s2_enc.c +++ b/crypto/openssl/ssl/s2_enc.c @@ -54,8 +54,12 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ +#ifndef NO_SSL2 + #include <stdio.h> #include "ssl_locl.h" @@ -178,3 +182,4 @@ void ssl2_mac(SSL *s, unsigned char *md, int send) /* some would say I should zero the md context */ } +#endif diff --git a/crypto/openssl/ssl/s2_lib.c b/crypto/openssl/ssl/s2_lib.c index ff804d8..c0ed7ec 100644 --- a/crypto/openssl/ssl/s2_lib.c +++ b/crypto/openssl/ssl/s2_lib.c @@ -54,9 +54,11 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ -#ifndef NO_RSA +#ifndef NO_SSL2 #include <stdio.h> #include <openssl/rsa.h> #include <openssl/objects.h> diff --git a/crypto/openssl/ssl/s2_meth.c b/crypto/openssl/ssl/s2_meth.c index e2add16..0e93c99 100644 --- a/crypto/openssl/ssl/s2_meth.c +++ b/crypto/openssl/ssl/s2_meth.c @@ -54,9 +54,11 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ -#ifndef NO_RSA +#ifndef NO_SSL2 #include <stdio.h> #include <openssl/objects.h> #include "ssl_locl.h" diff --git a/crypto/openssl/ssl/s2_pkt.c b/crypto/openssl/ssl/s2_pkt.c index a1bb5bc..5330d79 100644 --- a/crypto/openssl/ssl/s2_pkt.c +++ b/crypto/openssl/ssl/s2_pkt.c @@ -54,8 +54,12 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ +#ifndef NO_SSL2 + #include <stdio.h> #include <errno.h> #define USE_SOCKETS @@ -638,3 +642,5 @@ static int ssl_mt_error(int n) } return(ret); } + +#endif diff --git a/crypto/openssl/ssl/s2_srvr.c b/crypto/openssl/ssl/s2_srvr.c index 9aeedef..8dd19f9 100644 --- a/crypto/openssl/ssl/s2_srvr.c +++ b/crypto/openssl/ssl/s2_srvr.c @@ -54,9 +54,11 @@ * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] + * + * $FreeBSD$ */ -#ifndef NO_RSA +#ifndef NO_SSL2 #include <stdio.h> #include <openssl/bio.h> #include <openssl/rand.h> |