mirror of
https://github.com/mozilla/cipherscan.git
synced 2024-11-22 14:23:41 +01:00
Revert "no need to grep the input when we're using awk"
This reverts commit 4c05897be2
.
This commit is contained in:
parent
34b2eb7819
commit
2858ef8116
13
cipherscan
13
cipherscan
@ -108,21 +108,20 @@ test_cipher_on_target() {
|
|||||||
tmp=$(awk 'BEGIN { pr="yes" } /^======================================/ { if ( pr=="yes" ) pr="no"; else pr="yes" } { if ( pr == "yes" ) print }' <<<"$tmp")
|
tmp=$(awk 'BEGIN { pr="yes" } /^======================================/ { if ( pr=="yes" ) pr="no"; else pr="yes" } { if ( pr == "yes" ) print }' <<<"$tmp")
|
||||||
|
|
||||||
# session metadata
|
# session metadata
|
||||||
current_cipher=$(awk '/New, / {print $5; exit}' <<<"$tmp")
|
current_cipher=$(grep "New, " <<<"$tmp"|awk '{print $5}')
|
||||||
current_pfs=$(awk '/Server Temp Key/ {print $4$5$6$7; exit}' <<<"$tmp")
|
current_pfs=$(grep 'Server Temp Key' <<<"$tmp"|awk '{print $4$5$6$7}')
|
||||||
current_protocol=$(awk '/^\s+Protocol\s+:/ {print $3; exit}' <<<"$tmp")
|
current_protocol=$(egrep "^\s+Protocol\s+:" <<<"$tmp"|awk '{print $3}')
|
||||||
current_tickethint=$(awk '/ticket lifetime hint/ {print $6; exit}' <<<"$tmp")
|
current_tickethint=$(grep 'ticket lifetime hint' <<<"$tmp"|awk '{print $6 }')
|
||||||
if [ -z $current_tickethint ]; then
|
if [ -z $current_tickethint ]; then
|
||||||
current_tickethint=None
|
current_tickethint=None
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# certificate metadata
|
# certificate metadata
|
||||||
current_pubkey=$(awk '/Server public key is / {print $5;exit}' <<<"$tmp")
|
current_pubkey=$(grep 'Server public key is ' <<<"$tmp"|awk '{print $5}')
|
||||||
if [ -z $current_pubkey ]; then
|
if [ -z $current_pubkey ]; then
|
||||||
current_pubkey=0
|
current_pubkey=0
|
||||||
fi
|
fi
|
||||||
current_sigalg=$(${OPENSSLBIN} x509 -noout -text 2>/dev/null <<<"$tmp"|\
|
current_sigalg=$(${OPENSSLBIN} x509 -noout -text 2>/dev/null <<<"$tmp"|grep Signature\ Algorithm | head -n 1 | awk '{print $3}') || current_sigalg="None"
|
||||||
awk '/Signature Algorithm/ {print $3; exit}') || current_sigalg="None"
|
|
||||||
grep 'Verify return code: 0 ' <<<"$tmp" >/dev/null
|
grep 'Verify return code: 0 ' <<<"$tmp" >/dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
current_trusted="True"
|
current_trusted="True"
|
||||||
|
Loading…
Reference in New Issue
Block a user