mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-11-03 23:35:26 +01:00 
			
		
		
		
	Merge pull request #1486 from drwetter/fix_ids_friendly
Fix --ids-friendly
This commit is contained in:
		
							
								
								
									
										27
									
								
								testssl.sh
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								testssl.sh
									
									
									
									
									
								
							@@ -20088,7 +20088,7 @@ set_scanning_defaults() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# returns number of $do variables set = number of run_funcs() to perform
 | 
					# returns number of $do variables set = number of run_funcs() to perform
 | 
				
			||||||
query_globals() {
 | 
					count_do_variables() {
 | 
				
			||||||
     local gbl
 | 
					     local gbl
 | 
				
			||||||
     local true_nr=0
 | 
					     local true_nr=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20172,14 +20172,8 @@ parse_cmd_line() {
 | 
				
			|||||||
     CMDLINE="$(create_cmd_line_string "${CMDLINE_ARRAY[@]}")"
 | 
					     CMDLINE="$(create_cmd_line_string "${CMDLINE_ARRAY[@]}")"
 | 
				
			||||||
     CMDLINE_PARSED=false
 | 
					     CMDLINE_PARSED=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     # Show usage if no options were specified
 | 
					 | 
				
			||||||
     [[ -z "$1" ]] && help 0
 | 
					 | 
				
			||||||
     # Set defaults if only an URI was specified, maybe ToDo: use "="-option, then: ${i#*=} i.e. substring removal
 | 
					 | 
				
			||||||
     [[ "$#" -eq 1 ]] && set_scanning_defaults
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     while [[ $# -gt 0 ]]; do
 | 
					 | 
				
			||||||
     case $1 in
 | 
					     case $1 in
 | 
				
			||||||
               --help)
 | 
					          --help|"")
 | 
				
			||||||
               help 0
 | 
					               help 0
 | 
				
			||||||
               ;;
 | 
					               ;;
 | 
				
			||||||
          -b|--banner|-v|--version)
 | 
					          -b|--banner|-v|--version)
 | 
				
			||||||
@@ -20190,6 +20184,13 @@ parse_cmd_line() {
 | 
				
			|||||||
               mybanner
 | 
					               mybanner
 | 
				
			||||||
               exit $ALLOK
 | 
					               exit $ALLOK
 | 
				
			||||||
               ;;
 | 
					               ;;
 | 
				
			||||||
 | 
					     esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     # initializing
 | 
				
			||||||
 | 
					     initialize_globals
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     while [[ $# -gt 0 ]]; do
 | 
				
			||||||
 | 
					          case $1 in
 | 
				
			||||||
               --mx)
 | 
					               --mx)
 | 
				
			||||||
                    do_mx_all_ips=true
 | 
					                    do_mx_all_ips=true
 | 
				
			||||||
                    PORT=25
 | 
					                    PORT=25
 | 
				
			||||||
@@ -20691,8 +20692,9 @@ parse_cmd_line() {
 | 
				
			|||||||
     done
 | 
					     done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     [[ "$DEBUG" -ge 5 ]] && debug_globals
 | 
					     [[ "$DEBUG" -ge 5 ]] && debug_globals
 | 
				
			||||||
     # if we have no "do_*" set here --> query_globals: we do a standard run -- otherwise just the one specified
 | 
					
 | 
				
			||||||
     query_globals && set_scanning_defaults
 | 
					     count_do_variables
 | 
				
			||||||
 | 
					     [[ $? -eq 0 ]] && set_scanning_defaults
 | 
				
			||||||
     CMDLINE_PARSED=true
 | 
					     CMDLINE_PARSED=true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20935,9 +20937,10 @@ lets_roll() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
     #TODO: there shouldn't be the need for a special case for --mx, only the ip addresses we would need upfront and the do-parser
 | 
					     #TODO: there shouldn't be the need for a special case for --mx, only the ip addresses we would need upfront and the do-parser
 | 
				
			||||||
     if "$do_mx_all_ips"; then
 | 
					     if "$do_mx_all_ips"; then
 | 
				
			||||||
          query_globals                                # if we have just 1x "do_*" --> we do a standard run -- otherwise just the one specified
 | 
					          #FIXME: do we need this really here?
 | 
				
			||||||
 | 
					          count_do_variables                           # if we have just 1x "do_*" --> we do a standard run -- otherwise just the one specified
 | 
				
			||||||
          [[ $? -eq 1 ]] && set_scanning_defaults
 | 
					          [[ $? -eq 1 ]] && set_scanning_defaults
 | 
				
			||||||
          run_mx_all_ips "${URI}" $PORT                # we should reduce run_mx_all_ips to the stuff necessary as ~15 lines later we have similar code
 | 
					          run_mx_all_ips "${URI}" $PORT                # we should reduce run_mx_all_ips to what's necessary as below we have similar code
 | 
				
			||||||
          exit $?
 | 
					          exit $?
 | 
				
			||||||
     fi
 | 
					     fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user