@@ -1500,11 +1500,11 @@ int ssl_print_tmp_key(struct sslCheckOptions *options, SSL *s)
1500
1500
return 1 ;
1501
1501
switch (EVP_PKEY_id (key )) {
1502
1502
case EVP_PKEY_RSA :
1503
- if (EVP_PKEY_bits (key ) <= 768 )
1503
+ if (EVP_PKEY_bits (key ) <= 1024 )
1504
1504
{
1505
1505
printf (" RSA %s%d%s bits" , COL_RED , EVP_PKEY_bits (key ), RESET );
1506
1506
}
1507
- else if (EVP_PKEY_bits (key ) <= 1024 )
1507
+ else if (EVP_PKEY_bits (key ) <= 2048 )
1508
1508
{
1509
1509
printf (" RSA %s%d%s bits" , COL_YELLOW , EVP_PKEY_bits (key ), RESET );
1510
1510
}
@@ -1515,11 +1515,11 @@ int ssl_print_tmp_key(struct sslCheckOptions *options, SSL *s)
1515
1515
break ;
1516
1516
1517
1517
case EVP_PKEY_DH :
1518
- if (EVP_PKEY_bits (key ) <= 768 )
1518
+ if (EVP_PKEY_bits (key ) <= 1024 )
1519
1519
{
1520
1520
printf (" DHE %s%d%s bits" , COL_RED , EVP_PKEY_bits (key ), RESET );
1521
1521
}
1522
- else if (EVP_PKEY_bits (key ) <= 1024 )
1522
+ else if (EVP_PKEY_bits (key ) < 2048 )
1523
1523
{
1524
1524
printf (" DHE %s%d%s bits" , COL_YELLOW , EVP_PKEY_bits (key ), RESET );
1525
1525
}
@@ -1639,10 +1639,10 @@ void outputCipher(struct sslCheckOptions *options, SSL *ssl, const char *cleanSs
1639
1639
printf ("%s??%s bits " , COL_YELLOW , RESET );
1640
1640
} else if (cipherbits == 0 ) {
1641
1641
printf ("%s%d%s bits " , COL_RED_BG , cipherbits , RESET );
1642
+ } else if (cipherbits == 112 ) {
1643
+ printf ("%s%d%s bits " , COL_YELLOW , cipherbits , RESET );
1642
1644
} else if (cipherbits >= 112 ) {
1643
1645
printf ("%s%d%s bits " , COL_GREEN , cipherbits , RESET );
1644
- } else if (cipherbits > 56 ) {
1645
- printf ("%s%d%s bits " , COL_YELLOW , cipherbits , RESET );
1646
1646
} else
1647
1647
printf ("%s%d%s bits " , COL_RED , cipherbits , RESET );
1648
1648
@@ -1666,10 +1666,10 @@ void outputCipher(struct sslCheckOptions *options, SSL *ssl, const char *cleanSs
1666
1666
strength = "null" ;
1667
1667
} else if (strstr (ciphername , "ADH" ) || strstr (ciphername , "AECDH" ) || strstr (ciphername , "_anon_" )) {
1668
1668
if (options -> ianaNames ) {
1669
- printf ("%s%-45s%s" , COL_PURPLE , ciphername , RESET );
1669
+ printf ("%s%-45s%s" , COL_RED_BG , ciphername , RESET );
1670
1670
}
1671
1671
else {
1672
- printf ("%s%-29s%s" , COL_PURPLE , ciphername , RESET );
1672
+ printf ("%s%-29s%s" , COL_RED_BG , ciphername , RESET );
1673
1673
}
1674
1674
strength = "anonymous" ;
1675
1675
} else if (strstr (ciphername , "EXP" )) {
@@ -1680,6 +1680,15 @@ void outputCipher(struct sslCheckOptions *options, SSL *ssl, const char *cleanSs
1680
1680
printf ("%s%-29s%s" , COL_RED , ciphername , RESET );
1681
1681
}
1682
1682
strength = "weak" ;
1683
+ } else if (strstr (ciphername , "MD5" )) {
1684
+ /* SHA-1 isn't really exploitable in the contxt of TLS, but there's no reason to be using it any more */
1685
+ if (options -> ianaNames ) {
1686
+ printf ("%s%-45s%s" , COL_RED , ciphername , RESET );
1687
+ }
1688
+ else {
1689
+ printf ("%s%-29s%s" , COL_RED , ciphername , RESET );
1690
+ }
1691
+ strength = "medium" ;
1683
1692
} else if (strstr (ciphername , "RC4" ) || strstr (ciphername , "DES" )) {
1684
1693
if (options -> ianaNames ) {
1685
1694
printf ("%s%-45s%s" , COL_YELLOW , ciphername , RESET );
@@ -1702,18 +1711,18 @@ void outputCipher(struct sslCheckOptions *options, SSL *ssl, const char *cleanSs
1702
1711
strength = "medium" ;
1703
1712
} else if (strstr (ciphername , "_SM4_" )) { /* Developed by Chinese government */
1704
1713
if (options -> ianaNames ) {
1705
- printf ("%s%-45s%s" , COL_YELLOW , ciphername , RESET );
1714
+ printf ("%s%-45s%s" , COL_RED , ciphername , RESET );
1706
1715
}
1707
1716
else {
1708
- printf ("%s%-29s%s" , COL_YELLOW , ciphername , RESET );
1717
+ printf ("%s%-29s%s" , COL_RED , ciphername , RESET );
1709
1718
}
1710
1719
strength = "medium" ;
1711
1720
} else if (strstr (ciphername , "_GOSTR341112_" )) { /* Developed by Russian government */
1712
1721
if (options -> ianaNames ) {
1713
- printf ("%s%-45s%s" , COL_YELLOW , ciphername , RESET );
1722
+ printf ("%s%-45s%s" , COL_RED , ciphername , RESET );
1714
1723
}
1715
1724
else {
1716
- printf ("%s%-29s%s" , COL_YELLOW , ciphername , RESET );
1725
+ printf ("%s%-29s%s" , COL_RED , ciphername , RESET );
1717
1726
}
1718
1727
strength = "medium" ;
1719
1728
} else if ((strstr (ciphername , "CHACHA20" ) || (strstr (ciphername , "GCM" ))) && (strstr (ciphername , "DHE" ) || (strcmp (cleanSslMethod , "TLSv1.3" ) == 0 ))) {
@@ -1724,6 +1733,15 @@ void outputCipher(struct sslCheckOptions *options, SSL *ssl, const char *cleanSs
1724
1733
printf ("%s%-29s%s" , COL_GREEN , ciphername , RESET );
1725
1734
}
1726
1735
strength = "strong" ;
1736
+ } else if (strstr (ciphername , "SHA" ) && !(strstr (ciphername , "SHA256" ) || strstr (ciphername , "SHA384" ))) {
1737
+ /* SHA-1 isn't really exploitable in the contxt of TLS, but there's no reason to be using it any more */
1738
+ if (options -> ianaNames ) {
1739
+ printf ("%s%-45s%s" , COL_YELLOW , ciphername , RESET );
1740
+ }
1741
+ else {
1742
+ printf ("%s%-29s%s" , COL_YELLOW , ciphername , RESET );
1743
+ }
1744
+ strength = "medium" ;
1727
1745
} else {
1728
1746
if (options -> ianaNames ) {
1729
1747
printf ("%-45s" , ciphername );
@@ -2082,7 +2100,7 @@ int checkCertificate(struct sslCheckOptions *options, const SSL_METHOD *sslMetho
2082
2100
2083
2101
if (keyBits < 112 )
2084
2102
color = COL_RED ;
2085
- else if (keyBits < 128 )
2103
+ else if (keyBits <= 128 )
2086
2104
color = COL_YELLOW ;
2087
2105
2088
2106
printf ("ECC Curve Name: %s\n" , ec_group_name );
0 commit comments