Add conditional unit testing interface.
Don't call internal functions directly call them through
SSL_test_functions(). This also makes unit testing work on
Windows and platforms that don't export internal functions
from shared libraries.
By default unit testing is not enabled: it requires the compile
time option "enable-unit-test".
Reviewed-by: Geoff Thorpe <geoff@openssl.org>
(cherry picked from commit e0fc7961c4)
Conflicts:
	ssl/Makefile
	util/mkdef.pl
			
			
This commit is contained in:
		@@ -38,14 +38,17 @@
 | 
			
		||||
 * http://mike-bland.com/tags/heartbleed.html
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define OPENSSL_UNIT_TEST
 | 
			
		||||
 | 
			
		||||
#include "../test/testutil.h"
 | 
			
		||||
 | 
			
		||||
#include "../ssl/ssl_locl.h"
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_HEARTBEATS) && !defined(OPENSSL_SYS_WINDOWS)
 | 
			
		||||
#if !defined(OPENSSL_NO_HEARTBEATS) && !defined(OPENSSL_NO_UNIT_TEST)
 | 
			
		||||
 | 
			
		||||
/* As per https://tools.ietf.org/html/rfc6520#section-4 */
 | 
			
		||||
#define MIN_PADDING_SIZE	16
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user