Blame SOURCES/openssl-fips-0.9.8e-cve-2008-5077.patch

5820f5
diff -up openssl-fips-0.9.8e/apps/speed.c.verifysig openssl-fips-0.9.8e/apps/speed.c
5820f5
--- openssl-fips-0.9.8e/apps/speed.c.verifysig	2007-05-21 14:40:06.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/apps/speed.c	2008-12-16 16:44:22.000000000 +0100
5820f5
@@ -2132,7 +2132,7 @@ int MAIN(int argc, char **argv)
5820f5
 				{
5820f5
 				ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
5820f5
 					rsa_num, rsa_key[j]);
5820f5
-				if (ret == 0)
5820f5
+				if (ret <= 0)
5820f5
 					{
5820f5
 					BIO_printf(bio_err,
5820f5
 						"RSA verify failure\n");
5820f5
diff -up openssl-fips-0.9.8e/apps/verify.c.verifysig openssl-fips-0.9.8e/apps/verify.c
5820f5
--- openssl-fips-0.9.8e/apps/verify.c.verifysig	2004-11-29 12:28:07.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/apps/verify.c	2008-12-16 16:44:22.000000000 +0100
5820f5
@@ -266,7 +266,7 @@ static int check(X509_STORE *ctx, char *
5820f5
 
5820f5
 	ret=0;
5820f5
 end:
5820f5
-	if (i)
5820f5
+	if (i > 0)
5820f5
 		{
5820f5
 		fprintf(stdout,"OK\n");
5820f5
 		ret=1;
5820f5
@@ -367,4 +367,3 @@ static int MS_CALLBACK cb(int ok, X509_S
5820f5
 		ERR_clear_error();
5820f5
 	return(ok);
5820f5
 	}
5820f5
-
5820f5
diff -up openssl-fips-0.9.8e/apps/spkac.c.verifysig openssl-fips-0.9.8e/apps/spkac.c
5820f5
--- openssl-fips-0.9.8e/apps/spkac.c.verifysig	2005-04-05 21:11:18.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/apps/spkac.c	2008-12-16 16:44:22.000000000 +0100
5820f5
@@ -285,7 +285,7 @@ bad:
5820f5
 	pkey = NETSCAPE_SPKI_get_pubkey(spki);
5820f5
 	if(verify) {
5820f5
 		i = NETSCAPE_SPKI_verify(spki, pkey);
5820f5
-		if(i) BIO_printf(bio_err, "Signature OK\n");
5820f5
+		if (i > 0) BIO_printf(bio_err, "Signature OK\n");
5820f5
 		else {
5820f5
 			BIO_printf(bio_err, "Signature Failure\n");
5820f5
 			ERR_print_errors(bio_err);
5820f5
diff -up openssl-fips-0.9.8e/apps/x509.c.verifysig openssl-fips-0.9.8e/apps/x509.c
5820f5
--- openssl-fips-0.9.8e/apps/x509.c.verifysig	2005-07-16 13:13:03.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/apps/x509.c	2008-12-16 16:44:22.000000000 +0100
5820f5
@@ -1144,7 +1144,7 @@ static int x509_certify(X509_STORE *ctx,
5820f5
 	/* NOTE: this certificate can/should be self signed, unless it was
5820f5
 	 * a certificate request in which case it is not. */
5820f5
 	X509_STORE_CTX_set_cert(&xsc,x);
5820f5
-	if (!reqfile && !X509_verify_cert(&xsc))
5820f5
+	if (!reqfile && X509_verify_cert(&xsc) <= 0)
5820f5
 		goto end;
5820f5
 
5820f5
 	if (!X509_check_private_key(xca,pkey))
5820f5
diff -up openssl-fips-0.9.8e/ssl/s2_clnt.c.verifysig openssl-fips-0.9.8e/ssl/s2_clnt.c
5820f5
--- openssl-fips-0.9.8e/ssl/s2_clnt.c.verifysig	2006-09-28 13:29:03.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/ssl/s2_clnt.c	2008-12-16 16:44:50.000000000 +0100
5820f5
@@ -1044,7 +1044,7 @@ int ssl2_set_certificate(SSL *s, int typ
5820f5
 
5820f5
 	i=ssl_verify_cert_chain(s,sk);
5820f5
 		
5820f5
-	if ((s->verify_mode != SSL_VERIFY_NONE) && (!i))
5820f5
+	if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0))
5820f5
 		{
5820f5
 		SSLerr(SSL_F_SSL2_SET_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED);
5820f5
 		goto err;
5820f5
diff -up openssl-fips-0.9.8e/ssl/s2_srvr.c.verifysig openssl-fips-0.9.8e/ssl/s2_srvr.c
5820f5
--- openssl-fips-0.9.8e/ssl/s2_srvr.c.verifysig	2005-12-05 18:32:20.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/ssl/s2_srvr.c	2008-12-16 16:47:28.000000000 +0100
5820f5
@@ -1054,7 +1054,7 @@ static int request_certificate(SSL *s)
5820f5
 
5820f5
 	i=ssl_verify_cert_chain(s,sk);
5820f5
 
5820f5
-	if (i)	/* we like the packet, now check the chksum */
5820f5
+	if (i > 0)	/* we like the packet, now check the chksum */
5820f5
 		{
5820f5
 		EVP_MD_CTX ctx;
5820f5
 		EVP_PKEY *pkey=NULL;
5820f5
@@ -1083,7 +1083,7 @@ static int request_certificate(SSL *s)
5820f5
 		EVP_PKEY_free(pkey);
5820f5
 		EVP_MD_CTX_cleanup(&ctx;;
5820f5
 
5820f5
-		if (i) 
5820f5
+		if (i > 0) 
5820f5
 			{
5820f5
 			if (s->session->peer != NULL)
5820f5
 				X509_free(s->session->peer);
5820f5
diff -up openssl-fips-0.9.8e/ssl/s3_clnt.c.verifysig openssl-fips-0.9.8e/ssl/s3_clnt.c
5820f5
--- openssl-fips-0.9.8e/ssl/s3_clnt.c.verifysig	2008-10-31 09:18:53.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/ssl/s3_clnt.c	2008-12-16 16:44:50.000000000 +0100
5820f5
@@ -886,7 +886,7 @@ int ssl3_get_server_certificate(SSL *s)
5820f5
 		}
5820f5
 
5820f5
 	i=ssl_verify_cert_chain(s,sk);
5820f5
-	if ((s->verify_mode != SSL_VERIFY_NONE) && (!i)
5820f5
+	if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0)
5820f5
 #ifndef OPENSSL_NO_KRB5
5820f5
 	        && (s->s3->tmp.new_cipher->algorithms & (SSL_MKEY_MASK|SSL_AUTH_MASK))
5820f5
 	        != (SSL_aKRB5|SSL_kKRB5)
5820f5
@@ -1373,7 +1373,7 @@ int ssl3_get_key_exchange(SSL *s)
5820f5
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
5820f5
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
5820f5
 			EVP_VerifyUpdate(&md_ctx,param,param_len);
5820f5
-			if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
5820f5
+			if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
5820f5
 				{
5820f5
 				/* bad signature */
5820f5
 				al=SSL_AD_DECRYPT_ERROR;
5820f5
@@ -1391,7 +1391,7 @@ int ssl3_get_key_exchange(SSL *s)
5820f5
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
5820f5
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
5820f5
 			EVP_VerifyUpdate(&md_ctx,param,param_len);
5820f5
-			if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
5820f5
+			if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
5820f5
 				{
5820f5
 				/* bad signature */
5820f5
 				al=SSL_AD_DECRYPT_ERROR;
5820f5
diff -up openssl-fips-0.9.8e/ssl/ssltest.c.verifysig openssl-fips-0.9.8e/ssl/ssltest.c
5820f5
--- openssl-fips-0.9.8e/ssl/ssltest.c.verifysig	2007-08-21 17:26:51.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/ssl/ssltest.c	2008-12-16 16:44:50.000000000 +0100
5820f5
@@ -2093,7 +2093,7 @@ static int MS_CALLBACK app_verify_callba
5820f5
 
5820f5
 	if (cb_arg->proxy_auth)
5820f5
 		{
5820f5
-		if (ok)
5820f5
+		if (ok > 0)
5820f5
 			{
5820f5
 			const char *cond_end = NULL;
5820f5
 
5820f5
diff -up openssl-fips-0.9.8e/ssl/s3_srvr.c.verifysig openssl-fips-0.9.8e/ssl/s3_srvr.c
5820f5
--- openssl-fips-0.9.8e/ssl/s3_srvr.c.verifysig	2008-10-31 09:18:53.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/ssl/s3_srvr.c	2008-12-16 16:44:50.000000000 +0100
5820f5
@@ -2484,7 +2484,7 @@ int ssl3_get_client_certificate(SSL *s)
5820f5
 	else
5820f5
 		{
5820f5
 		i=ssl_verify_cert_chain(s,sk);
5820f5
-		if (!i)
5820f5
+		if (i <= 0)
5820f5
 			{
5820f5
 			al=ssl_verify_alarm_type(s->verify_result);
5820f5
 			SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE,SSL_R_NO_CERTIFICATE_RETURNED);