mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-31 13:55:25 +01:00 
			
		
		
		
	includes IPv6 check and is ready for other uname's
This commit is contained in:
		| @@ -13,7 +13,7 @@ sleep 3 | ||||
| STDOPTIONS="--prefix=/usr/ --openssldir=/etc/ssl -DOPENSSL_USE_BUILD_DATE enable-zlib \ | ||||
| enable-ssl2 enable-ssl3 enable-ssl-trace enable-rc5 enable-rc2 \ | ||||
| enable-gost enable-cms enable-md2 enable-mdc2 enable-ec enable-ec2m enable-ecdh enable-ecdsa \ | ||||
| enable-seed enable-camellia enable-idea enable-rfc3779 experimental-jpake -DTEMP_GOST_TLS" | ||||
| enable-seed enable-camellia enable-idea enable-rfc3779 experimental-jpake" | ||||
|  | ||||
| clean() { | ||||
| 	case $NOCLEAN in  | ||||
| @@ -42,48 +42,76 @@ makeall() { | ||||
|  | ||||
| copyfiles() { | ||||
| 	echo; apps/openssl version -a; echo | ||||
| 	cp -p apps/openssl ../openssl.$(uname).$(uname -m).$1 | ||||
| 	echo | ||||
| 	if grep static <<< "$1"; then | ||||
| 		cp -p apps/openssl ../openssl.$(uname).$(uname -m) | ||||
| 	else | ||||
| 		cp -p apps/openssl ../openssl.$(uname).$(uname -m).krb5 | ||||
| 	fi | ||||
| 	return $? | ||||
| } | ||||
|  | ||||
| case $(uname -m) in | ||||
| 	"i686") clean  | ||||
| 		if [[ "$1" = krb ]]; then | ||||
| 			name2add=krb | ||||
| 			./config $STDOPTIONS no-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT | ||||
| 		else | ||||
| 			name2add=static | ||||
| 			./config $STDOPTIONS no-ec_nistp_64_gcc_128 -static | ||||
| 		fi | ||||
| 		[ $? -ne 0 ] && error "configuring" | ||||
| 		makeall && copyfiles "$name2add" | ||||
| 		[ $? -ne 0 ] && error "copying files" | ||||
| 		apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l | ||||
| 		echo | ||||
| 		echo "------------ all ok ------------" | ||||
| testv6_patch() { | ||||
| 	if grep -q 'ending bracket for IPv6' apps/s_socket.c; then | ||||
| 		STDOPTIONS += "-DOPENSSL_USE_IPV6" | ||||
| 	else | ||||
| 		echo  | ||||
| 		;; | ||||
| 	"x86_64") clean | ||||
| 		if [[ "$1" = krb ]]; then | ||||
| 			name2add=krb | ||||
| 			./config $STDOPTIONS enable-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT | ||||
| 		else | ||||
| 			name2add=static | ||||
| 			./config $STDOPTIONS enable-ec_nistp_64_gcc_128 -static | ||||
| 		fi | ||||
| 		[ $? -ne 0 ] && error "configuring" | ||||
| 		makeall && copyfiles "$name2add" | ||||
| 		[ $? -ne 0 ] && error "copying files" | ||||
| 		apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l | ||||
| 		echo "no IPv6 patch (Fedora) detected!!  -- Press ^C and dl & apply from" | ||||
| 		echo "https://github.com/drwetter/testssl.sh/blob/master/bin/fedora-dirk-ipv6.diff" | ||||
| 		echo "or press any key to ignore" | ||||
| 		echo | ||||
| 		echo "------------ all ok ------------" | ||||
| 		echo  | ||||
| 		read a | ||||
| 	fi | ||||
| } | ||||
|  | ||||
|  | ||||
| testv6_patch | ||||
|  | ||||
|  | ||||
| case $(uname) in | ||||
| 	Linux|FreeBSD) | ||||
| 		case $(uname -m) in | ||||
| 			"i686") clean  | ||||
| 				if [[ "$1" = krb ]]; then | ||||
| 					name2add=krb | ||||
| 					./config $STDOPTIONS no-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT | ||||
| 				else | ||||
| 					name2add=static | ||||
| 					./config $STDOPTIONS no-ec_nistp_64_gcc_128 -static | ||||
| 				fi | ||||
| 				[ $? -ne 0 ] && error "configuring" | ||||
| 				makeall && copyfiles "$name2add" | ||||
| 				[ $? -ne 0 ] && error "copying files" | ||||
| 				apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l | ||||
| 				echo | ||||
| 				echo "------------ all ok ------------" | ||||
| 				echo  | ||||
| 				;; | ||||
| 			"x86_64") clean | ||||
| 				if [[ "$1" = krb ]]; then | ||||
| 					name2add=krb | ||||
| 					./config $STDOPTIONS enable-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT | ||||
| 				else | ||||
| 					name2add=static | ||||
| 					./config $STDOPTIONS enable-ec_nistp_64_gcc_128 -static | ||||
| 				fi | ||||
| 				[ $? -ne 0 ] && error "configuring" | ||||
| 				makeall && copyfiles "$name2add" | ||||
| 				[ $? -ne 0 ] && error "copying files" | ||||
| 				apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l | ||||
| 				echo | ||||
| 				echo "------------ all ok ------------" | ||||
| 				echo  | ||||
| 				;; | ||||
| 			*)	echo " Sorry, don't know this architecture $(uname -m)"  | ||||
| 				exit 1 | ||||
| 				;; | ||||
| 		esac | ||||
| 		;; | ||||
| 	*)	echo " Sorry, don't know this architecture $(uname -m)"  | ||||
| 		exit 1 | ||||
| 	Darwin) | ||||
|  | ||||
| 		;; | ||||
| esac | ||||
| 		 | ||||
|  | ||||
| #  vim:tw=90:ts=5:sw=5 | ||||
| #  $Id: make-openssl.sh,v 1.14 2015/07/20 19:40:54 dirkw Exp $  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dirk
					Dirk