1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

Fix breakage when NO_RSA specified.

Reviewed by:	Ben Laurie <ben@openssl.org>
This commit is contained in:
Kris Kennaway 2000-01-14 05:24:08 +00:00
parent a9d565fcd2
commit ce600b6ae6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55949
9 changed files with 54 additions and 5 deletions

View File

@ -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) &&

View File

@ -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);
}

View File

@ -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 @@ int ssl23_get_client_hello(SSL *s)
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 @@ int ssl23_get_client_hello(SSL *s)
s->method=SSLv2_server_method();
s->handshake_func=s->method->ssl_accept;
#endif
}
if ((type == 2) || (type == 3))

View File

@ -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>

View File

@ -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

View File

@ -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>

View File

@ -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"

View File

@ -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

View File

@ -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>