mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +01:00
Merge pull request #1674 from dcooper16/rate_ciphers_in_json
Include cipher quality in JSON and CSV
This commit is contained in:
commit
b941d7db4a
24
testssl.sh
24
testssl.sh
@ -4378,7 +4378,7 @@ ciphers_by_strength() {
|
|||||||
outln "${sigalg[i]}"
|
outln "${sigalg[i]}"
|
||||||
id="cipher$proto"
|
id="cipher$proto"
|
||||||
id+="_${normalized_hexcode[i]}"
|
id+="_${normalized_hexcode[i]}"
|
||||||
fileout "$id" "INFO" "$proto_text $(neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}") $available"
|
fileout "$id" "$(get_cipher_quality_severity "${ciph[i]}")" "$proto_text $(neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}") $available"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -6204,6 +6204,26 @@ get_cipher_quality() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Output the severity level associated with the cipher in $1.
|
||||||
|
get_cipher_quality_severity() {
|
||||||
|
local cipher="$1"
|
||||||
|
local -i quality
|
||||||
|
|
||||||
|
[[ -z "$1" ]] && return 0
|
||||||
|
|
||||||
|
get_cipher_quality "$cipher"
|
||||||
|
quality=$?
|
||||||
|
case $quality in
|
||||||
|
1) tm_out "CRITICAL" ;;
|
||||||
|
2) tm_out "HIGH" ;;
|
||||||
|
3) tm_out "MEDIUM" ;;
|
||||||
|
4) tm_out "LOW" ;;
|
||||||
|
5) tm_out "INFO" ;;
|
||||||
|
6|7) tm_out "OK" ;;
|
||||||
|
esac
|
||||||
|
return $quality
|
||||||
|
}
|
||||||
|
|
||||||
# Print $2 based on the quality of the cipher in $1. If $2 is empty, just print $1.
|
# Print $2 based on the quality of the cipher in $1. If $2 is empty, just print $1.
|
||||||
# The return value is an indicator of the quality of the cipher in $1:
|
# The return value is an indicator of the quality of the cipher in $1:
|
||||||
# 0 = $1 is empty
|
# 0 = $1 is empty
|
||||||
@ -7051,7 +7071,7 @@ cipher_pref_check() {
|
|||||||
neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}" "true"
|
neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}" "true"
|
||||||
outln "${sigalg[i]}"
|
outln "${sigalg[i]}"
|
||||||
id="cipher-${proto}_${normalized_hexcode[i]}"
|
id="cipher-${proto}_${normalized_hexcode[i]}"
|
||||||
fileout "$id" "INFO" "$proto_text $(neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}")"
|
fileout "$id" "$(get_cipher_quality_severity "${ciph[i]}")" "$proto_text $(neat_list "${normalized_hexcode[i]}" "${ciph[i]}" "${kx[i]}" "${enc[i]}" "${export2[i]}")"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
outln
|
outln
|
||||||
|
Loading…
Reference in New Issue
Block a user