mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-09-17 09:22:54 +02:00
Rename variables
This commit is contained in:
35
testssl.sh
35
testssl.sh
@ -22372,9 +22372,9 @@ get_caa_rrecord() {
|
|||||||
get_https_rrecord() {
|
get_https_rrecord() {
|
||||||
local raw_https=""
|
local raw_https=""
|
||||||
local hash len line
|
local hash len line
|
||||||
local -i len_https_property
|
local -i len_alpnID
|
||||||
local https_property_name
|
local alpnID
|
||||||
local https_property_value
|
local alpnID_wire
|
||||||
local saved_openssl_conf="$OPENSSL_CONF"
|
local saved_openssl_conf="$OPENSSL_CONF"
|
||||||
local all_https=""
|
local all_https=""
|
||||||
local noidnout=""
|
local noidnout=""
|
||||||
@ -22482,32 +22482,31 @@ get_https_rrecord() {
|
|||||||
if [[ $svc_priority == 1 ]]; then
|
if [[ $svc_priority == 1 ]]; then
|
||||||
# mock text representation
|
# mock text representation
|
||||||
svc_priority="$svc_priority . "
|
svc_priority="$svc_priority . "
|
||||||
https_property_name="${https_property_name}${svc_priority}"
|
alpnID="${alpnID}${svc_priority}"
|
||||||
fi
|
fi
|
||||||
if [[ ${line:8:2} == 01 ]]; then # Then comes SvcParamKeys, see rfc 14.3.2 which should be alpn=-1
|
if [[ ${line:8:2} == 01 ]]; then # Then comes SvcParamKeys, see rfc 14.3.2 which should be alpn=1
|
||||||
https_property_name="${https_property_name}alpn=\""
|
alpnID="${alpnID}alpn=\"" # double quote for clear text
|
||||||
else
|
else
|
||||||
continue # If the 1st element is not alpn, next iteration of loop will fail.
|
continue # If the 1st element is not alpn, next iteration of loop will fail.
|
||||||
fi # Should we care as SvcParamKey!=alpn doesn't seems not very common?
|
fi # Should we care as SvcParamKey!=alpn doesn't seems not very common?
|
||||||
xlen_https_property=${line:12:2} # length of alpn entries
|
len_alpnID=${line:12:2} # length of alpn entries
|
||||||
https_property_value=${line:16:4} # first value
|
alpnID_wire=${line:16:4} # value of first entry
|
||||||
https_property_name=${https_property_name}$(hex2ascii $https_property_value)
|
alpnID=${alpnID}$(hex2ascii $alpnID_wire)
|
||||||
if [[ $xlen_https_property != 03 ]]; then # 06 would be another entry
|
if [[ $len_alpnID != 03 ]]; then # 06 would be another entry
|
||||||
https_property_value=${line:22:4} #FIXME: we can't cope with three entries yet
|
alpnID_wire=${line:22:4} #FIXME: we can't cope with three entries yet
|
||||||
https_property_name="${https_property_name},$(hex2ascii $https_property_value)"
|
alpnID="${alpnID},$(hex2ascii $alpnID_wire)"
|
||||||
fi
|
fi
|
||||||
[[ ${line:8:2} == 01 ]] && https_property_name="${https_property_name}\"" # if alpn add trailing double quote
|
[[ ${line:8:2} == 01 ]] && alpnID="${alpnID}\"" # if alpn add trailing double quote
|
||||||
|
|
||||||
# len_https_property=$((len_https_property*2)) # =>word! Now get name from 4th and value from 4th+len position...
|
# len_alpnID=$((len_alpnID*2)) # =>word! Now get name from 4th and value from 4th+len position...
|
||||||
# line="${line/ /}" # especially with iodefs there's a blank in the string which we just skip
|
# alpnID="$(hex2ascii ${line:4:$len_alpnID})"
|
||||||
# https_property_name="$(hex2ascii ${line:4:$len_https_property})"
|
# alpnID_wire="$(hex2ascii "${line:$((4+len_alpnID)):100}")"
|
||||||
# https_property_value="$(hex2ascii "${line:$((4+len_https_property)):100}")"
|
|
||||||
else
|
else
|
||||||
out "please report unknown HTTPS RR $line with flag @ $NODE"
|
out "please report unknown HTTPS RR $line with flag @ $NODE"
|
||||||
return 7
|
return 7
|
||||||
fi
|
fi
|
||||||
done <<< "$raw_https"
|
done <<< "$raw_https"
|
||||||
echo $https_property_name
|
safe_echo "$alpnID"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user