Is there a way to get the numeric-value for a openssl-cipher-suite

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to get the numeric-value for a openssl-cipher-suite

Ajay Garg
Hi All.

I am using the following script at myu laptop, to test for the available cipher-suites :

####################################################
#!/usr/bin/env bash

# OpenSSL requires the port number.
SERVER=server.ip.com:12345
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')

echo Obtaining cipher list from $(openssl version).

for cipher in ${ciphers[@]}
do
# echo -n Testing $cipher...
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
if [[ "$result" =~ ":error:" ]] ; then
    true
else
  if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher    :" ]] ; then
    echo ${cipher}
  else
      true
  fi
fi
sleep $DELAY
done
####################################################


Above script works, and I am able to get the supported-ciphers-listing.
But all those ciphers are in stringified-form.


Is there a way, so that I can get the supported-ciphers in their corrsponding numeric-values form?
I ask this, because a particular device supports only a restricted set of ciphers, and I am not able to properly match the cipher-suites using their stringified-forms.


Looking forward to some help from the experts :)



Thanks and Regards,
Ajay

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to get the numeric-value for a openssl-cipher-suite

Matt Caswell-2


On 14/12/16 08:09, Ajay Garg wrote:

> Hi All.
>
> I am using the following script at myu laptop, to test for the available
> cipher-suites :
>
> ####################################################
> #!/usr/bin/env bash
>
> # OpenSSL requires the port number.
> SERVER=server.ip.com:12345 <http://server.ip.com:12345>
> DELAY=1
> ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
>
> echo Obtaining cipher list from $(openssl version).
>
> for cipher in ${ciphers[@]}
> do
> # echo -n Testing $cipher...
> result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
> if [[ "$result" =~ ":error:" ]] ; then
>     true
> else
>   if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher    :"
> ]] ; then
>     echo ${cipher}
>   else
>       true
>   fi
> fi
> sleep $DELAY
> done
> ####################################################
>
>
> Above script works, and I am able to get the supported-ciphers-listing.
> But all those ciphers are in stringified-form.
>
>
> Is there a way, so that I can get the supported-ciphers in their
> corrsponding numeric-values form?

Try the -V option to the ciphers command.

Matt


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to get the numeric-value for a openssl-cipher-suite

Salz, Rich
In reply to this post by Ajay Garg
Does the -V flag not do what you want?
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users