summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-03-24 06:15:59 +0000
committertb <>2024-03-24 06:15:59 +0000
commitc441467ab2b63065d9334ca6b8aeb17830d6940a (patch)
tree403ea68a8a5d82e00a944cf58bbf8f902a110c3b
parenta5f3a65ab19c952e8148c2763aa6a6fd84940f19 (diff)
downloadopenbsd-c441467ab2b63065d9334ca6b8aeb17830d6940a.tar.gz
openbsd-c441467ab2b63065d9334ca6b8aeb17830d6940a.tar.bz2
openbsd-c441467ab2b63065d9334ca6b8aeb17830d6940a.zip
Remove OPENSSL_NO_* #ifdefs from evp_names.c
discussed with jsing
-rw-r--r--src/lib/libcrypto/evp/evp_names.c146
1 files changed, 1 insertions, 145 deletions
diff --git a/src/lib/libcrypto/evp/evp_names.c b/src/lib/libcrypto/evp/evp_names.c
index 83c2f53840..1b976ca05f 100644
--- a/src/lib/libcrypto/evp/evp_names.c
+++ b/src/lib/libcrypto/evp/evp_names.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_names.c,v 1.13 2024/03/24 06:05:41 tb Exp $ */ 1/* $OpenBSD: evp_names.c,v 1.14 2024/03/24 06:15:59 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -46,7 +46,6 @@ struct digest_name {
46 */ 46 */
47 47
48static const struct cipher_name cipher_names[] = { 48static const struct cipher_name cipher_names[] = {
49#ifndef OPENSSL_NO_AES
50 { 49 {
51 .name = SN_aes_128_cbc, 50 .name = SN_aes_128_cbc,
52 .cipher = EVP_aes_128_cbc, 51 .cipher = EVP_aes_128_cbc,
@@ -157,9 +156,7 @@ static const struct cipher_name cipher_names[] = {
157 .cipher = EVP_aes_256_cbc, 156 .cipher = EVP_aes_256_cbc,
158 .alias = SN_aes_256_cbc, 157 .alias = SN_aes_256_cbc,
159 }, 158 },
160#endif /* OPENSSL_NO_AES */
161 159
162#ifndef OPENSSL_NO_BF
163 { 160 {
164 .name = "BF", 161 .name = "BF",
165 .cipher = EVP_bf_cbc, 162 .cipher = EVP_bf_cbc,
@@ -182,9 +179,7 @@ static const struct cipher_name cipher_names[] = {
182 .name = SN_bf_ofb64, 179 .name = SN_bf_ofb64,
183 .cipher = EVP_bf_ofb, 180 .cipher = EVP_bf_ofb,
184 }, 181 },
185#endif
186 182
187#ifndef OPENSSL_NO_CAMELLIA
188 { 183 {
189 .name = SN_camellia_128_cbc, 184 .name = SN_camellia_128_cbc,
190 .cipher = EVP_camellia_128_cbc, 185 .cipher = EVP_camellia_128_cbc,
@@ -275,9 +270,7 @@ static const struct cipher_name cipher_names[] = {
275 .cipher = EVP_camellia_256_cbc, 270 .cipher = EVP_camellia_256_cbc,
276 .alias = SN_camellia_256_cbc, 271 .alias = SN_camellia_256_cbc,
277 }, 272 },
278#endif /* OPENSSL_NO_CAMELLIA */
279 273
280#ifndef OPENSSL_NO_CAST
281 { 274 {
282 .name = "CAST", 275 .name = "CAST",
283 .cipher = EVP_cast5_cbc, 276 .cipher = EVP_cast5_cbc,
@@ -305,9 +298,7 @@ static const struct cipher_name cipher_names[] = {
305 .name = SN_cast5_ofb64, 298 .name = SN_cast5_ofb64,
306 .cipher = EVP_cast5_ofb, 299 .cipher = EVP_cast5_ofb,
307 }, 300 },
308#endif
309 301
310#ifndef OPENSSL_NO_CHACHA
311 { 302 {
312 .name = SN_chacha20, 303 .name = SN_chacha20,
313 .cipher = EVP_chacha20, 304 .cipher = EVP_chacha20,
@@ -317,16 +308,12 @@ static const struct cipher_name cipher_names[] = {
317 .cipher = EVP_chacha20, 308 .cipher = EVP_chacha20,
318 .alias = SN_chacha20, 309 .alias = SN_chacha20,
319 }, 310 },
320#endif /* OPENSSL_NO_CHACHA */
321 311
322#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
323 { 312 {
324 .name = SN_chacha20_poly1305, 313 .name = SN_chacha20_poly1305,
325 .cipher = EVP_chacha20_poly1305, 314 .cipher = EVP_chacha20_poly1305,
326 }, 315 },
327#endif /* OPENSSL_NO_CHACHA && OPENSSL_NO_POLY1305 */
328 316
329#ifndef OPENSSL_NO_DES
330 { 317 {
331 .name = "DES", 318 .name = "DES",
332 .cipher = EVP_des_cbc, 319 .cipher = EVP_des_cbc,
@@ -413,9 +400,7 @@ static const struct cipher_name cipher_names[] = {
413 .name = SN_desx_cbc, 400 .name = SN_desx_cbc,
414 .cipher = EVP_desx_cbc, 401 .cipher = EVP_desx_cbc,
415 }, 402 },
416#endif /* OPENSSL_NO_DES */
417 403
418#ifndef OPENSSL_NO_IDEA
419 { 404 {
420 .name = "IDEA", 405 .name = "IDEA",
421 .cipher = EVP_idea_cbc, 406 .cipher = EVP_idea_cbc,
@@ -438,9 +423,7 @@ static const struct cipher_name cipher_names[] = {
438 .name = SN_idea_ofb64, 423 .name = SN_idea_ofb64,
439 .cipher = EVP_idea_ofb, 424 .cipher = EVP_idea_ofb,
440 }, 425 },
441#endif /* OPENSSL_NO_IDEA */
442 426
443#ifndef OPENSSL_NO_RC2
444 { 427 {
445 .name = "RC2", 428 .name = "RC2",
446 .cipher = EVP_rc2_cbc, 429 .cipher = EVP_rc2_cbc,
@@ -471,9 +454,7 @@ static const struct cipher_name cipher_names[] = {
471 .name = SN_rc2_ofb64, 454 .name = SN_rc2_ofb64,
472 .cipher = EVP_rc2_ofb, 455 .cipher = EVP_rc2_ofb,
473 }, 456 },
474#endif /* OPENSSL_NO_RC2 */
475 457
476#ifndef OPENSSL_NO_RC4
477 { 458 {
478 .name = SN_rc4, 459 .name = SN_rc4,
479 .cipher = EVP_rc4, 460 .cipher = EVP_rc4,
@@ -482,9 +463,7 @@ static const struct cipher_name cipher_names[] = {
482 .name = SN_rc4_40, 463 .name = SN_rc4_40,
483 .cipher = EVP_rc4_40, 464 .cipher = EVP_rc4_40,
484 }, 465 },
485#endif /* OPENSSL_NO_RC4 */
486 466
487#ifndef OPENSSL_NO_SM4
488 { 467 {
489 .name = "SM4", 468 .name = "SM4",
490 .cipher = EVP_sm4_cbc, 469 .cipher = EVP_sm4_cbc,
@@ -511,9 +490,7 @@ static const struct cipher_name cipher_names[] = {
511 .name = SN_sm4_ofb128, 490 .name = SN_sm4_ofb128,
512 .cipher = EVP_sm4_ofb, 491 .cipher = EVP_sm4_ofb,
513 }, 492 },
514#endif /* OPENSSL_NO_SM4 */
515 493
516#ifndef OPENSSL_NO_AES
517 { 494 {
518 .name = LN_aes_128_cbc, 495 .name = LN_aes_128_cbc,
519 .cipher = EVP_aes_128_cbc, 496 .cipher = EVP_aes_128_cbc,
@@ -648,9 +625,7 @@ static const struct cipher_name cipher_names[] = {
648 .cipher = EVP_aes_256_cbc, 625 .cipher = EVP_aes_256_cbc,
649 .alias = SN_aes_256_cbc, 626 .alias = SN_aes_256_cbc,
650 }, 627 },
651#endif /* OPENSSL_NO_AES */
652 628
653#ifndef OPENSSL_NO_BF
654 { 629 {
655 .name = "bf", 630 .name = "bf",
656 .cipher = EVP_bf_cbc, 631 .cipher = EVP_bf_cbc,
@@ -679,9 +654,7 @@ static const struct cipher_name cipher_names[] = {
679 .cipher = EVP_bf_cbc, 654 .cipher = EVP_bf_cbc,
680 .alias = SN_bf_cbc, 655 .alias = SN_bf_cbc,
681 }, 656 },
682#endif /* OPENSSL_NO_BF */
683 657
684#ifndef OPENSSL_NO_CAMELLIA
685 { 658 {
686 .name = LN_camellia_128_cbc, 659 .name = LN_camellia_128_cbc,
687 .cipher = EVP_camellia_128_cbc, 660 .cipher = EVP_camellia_128_cbc,
@@ -772,9 +745,7 @@ static const struct cipher_name cipher_names[] = {
772 .cipher = EVP_camellia_256_cbc, 745 .cipher = EVP_camellia_256_cbc,
773 .alias = SN_camellia_256_cbc, 746 .alias = SN_camellia_256_cbc,
774 }, 747 },
775#endif /* OPENSSL_NO_CAMELLIA */
776 748
777#ifndef OPENSSL_NO_CAST
778 { 749 {
779 .name = "cast", 750 .name = "cast",
780 .cipher = EVP_cast5_cbc, 751 .cipher = EVP_cast5_cbc,
@@ -802,9 +773,7 @@ static const struct cipher_name cipher_names[] = {
802 .name = LN_cast5_ofb64, 773 .name = LN_cast5_ofb64,
803 .cipher = EVP_cast5_ofb, 774 .cipher = EVP_cast5_ofb,
804 }, 775 },
805#endif
806 776
807#ifndef OPENSSL_NO_CHACHA
808 { 777 {
809 .name = LN_chacha20, 778 .name = LN_chacha20,
810 .cipher = EVP_chacha20, 779 .cipher = EVP_chacha20,
@@ -819,9 +788,7 @@ static const struct cipher_name cipher_names[] = {
819 .name = LN_chacha20_poly1305, 788 .name = LN_chacha20_poly1305,
820 .cipher = EVP_chacha20_poly1305, 789 .cipher = EVP_chacha20_poly1305,
821 }, 790 },
822#endif
823 791
824#ifndef OPENSSL_NO_DES
825 { 792 {
826 .name = "des", 793 .name = "des",
827 .cipher = EVP_des_cbc, 794 .cipher = EVP_des_cbc,
@@ -908,9 +875,7 @@ static const struct cipher_name cipher_names[] = {
908 .name = LN_desx_cbc, 875 .name = LN_desx_cbc,
909 .cipher = EVP_desx_cbc, 876 .cipher = EVP_desx_cbc,
910 }, 877 },
911#endif /* OPENSSL_NO_DES */
912 878
913#ifndef OPENSSL_NO_AES
914 { 879 {
915 .name = SN_aes_128_ccm, 880 .name = SN_aes_128_ccm,
916 .cipher = EVP_aes_128_ccm, 881 .cipher = EVP_aes_128_ccm,
@@ -949,9 +914,7 @@ static const struct cipher_name cipher_names[] = {
949 .name = SN_id_aes256_wrap, 914 .name = SN_id_aes256_wrap,
950 .cipher = EVP_aes_256_wrap, 915 .cipher = EVP_aes_256_wrap,
951 }, 916 },
952#endif /* OPENSSL_NO_AES */
953 917
954#ifndef OPENSSL_NO_IDEA
955 { 918 {
956 .name = "idea", 919 .name = "idea",
957 .cipher = EVP_idea_cbc, 920 .cipher = EVP_idea_cbc,
@@ -974,9 +937,7 @@ static const struct cipher_name cipher_names[] = {
974 .name = LN_idea_ofb64, 937 .name = LN_idea_ofb64,
975 .cipher = EVP_idea_ofb, 938 .cipher = EVP_idea_ofb,
976 }, 939 },
977#endif /* OPENSSL_NO_IDEA */
978 940
979#ifndef OPENSSL_NO_RC2
980 { 941 {
981 .name = "rc2", 942 .name = "rc2",
982 .cipher = EVP_rc2_cbc, 943 .cipher = EVP_rc2_cbc,
@@ -1007,9 +968,7 @@ static const struct cipher_name cipher_names[] = {
1007 .name = LN_rc2_ofb64, 968 .name = LN_rc2_ofb64,
1008 .cipher = EVP_rc2_ofb, 969 .cipher = EVP_rc2_ofb,
1009 }, 970 },
1010#endif /* OPENSSL_NO_RC2 */
1011 971
1012#ifndef OPENSSL_NO_RC4
1013 { 972 {
1014 .name = LN_rc4, 973 .name = LN_rc4,
1015 .cipher = EVP_rc4, 974 .cipher = EVP_rc4,
@@ -1018,9 +977,7 @@ static const struct cipher_name cipher_names[] = {
1018 .name = LN_rc4_40, 977 .name = LN_rc4_40,
1019 .cipher = EVP_rc4_40, 978 .cipher = EVP_rc4_40,
1020 }, 979 },
1021#endif /* OPENSSL_NO_RC4 */
1022 980
1023#ifndef OPENSSL_NO_SM4
1024 { 981 {
1025 .name = "sm4", 982 .name = "sm4",
1026 .cipher = EVP_sm4_cbc, 983 .cipher = EVP_sm4_cbc,
@@ -1047,7 +1004,6 @@ static const struct cipher_name cipher_names[] = {
1047 .name = LN_sm4_ofb128, 1004 .name = LN_sm4_ofb128,
1048 .cipher = EVP_sm4_ofb, 1005 .cipher = EVP_sm4_ofb,
1049 }, 1006 },
1050#endif /* OPENSSL_NO_SM4 */
1051}; 1007};
1052 1008
1053#define N_CIPHER_NAMES (sizeof(cipher_names) / sizeof(cipher_names[0])) 1009#define N_CIPHER_NAMES (sizeof(cipher_names) / sizeof(cipher_names[0]))
@@ -1058,65 +1014,47 @@ static const struct cipher_name cipher_names[] = {
1058 */ 1014 */
1059 1015
1060static const struct digest_name digest_names[] = { 1016static const struct digest_name digest_names[] = {
1061#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA1)
1062 { 1017 {
1063 .name = SN_dsaWithSHA1, 1018 .name = SN_dsaWithSHA1,
1064 .digest = EVP_sha1, 1019 .digest = EVP_sha1,
1065 .alias = SN_sha1, 1020 .alias = SN_sha1,
1066 }, 1021 },
1067#endif
1068 1022
1069#ifndef OPENSSL_NO_MD4
1070 { 1023 {
1071 .name = SN_md4, 1024 .name = SN_md4,
1072 .digest = EVP_md4, 1025 .digest = EVP_md4,
1073 }, 1026 },
1074#endif /* OPENSSL_NO_MD4 */
1075 1027
1076#ifndef OPENSSL_NO_MD5
1077 { 1028 {
1078 .name = SN_md5, 1029 .name = SN_md5,
1079 .digest = EVP_md5, 1030 .digest = EVP_md5,
1080 }, 1031 },
1081#endif /* OPENSSL_NO_MD5 */
1082 1032
1083#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_SHA1)
1084 { 1033 {
1085 .name = SN_md5_sha1, 1034 .name = SN_md5_sha1,
1086 .digest = EVP_md5_sha1, 1035 .digest = EVP_md5_sha1,
1087 }, 1036 },
1088#endif /* OPENSSL_NO_MD5 && OPENSSL_NO_SHA1 */
1089 1037
1090#ifndef OPENSSL_NO_RIPEMD
1091 { 1038 {
1092 .name = SN_ripemd160, 1039 .name = SN_ripemd160,
1093 .digest = EVP_ripemd160, 1040 .digest = EVP_ripemd160,
1094 }, 1041 },
1095#endif /* OPENSSL_NO_RIPEMD */
1096 1042
1097#ifndef OPENSSL_NO_RSA
1098#ifndef OPENSSL_NO_MD4
1099 { 1043 {
1100 .name = SN_md4WithRSAEncryption, 1044 .name = SN_md4WithRSAEncryption,
1101 .digest = EVP_md4, 1045 .digest = EVP_md4,
1102 .alias = SN_md4, 1046 .alias = SN_md4,
1103 }, 1047 },
1104#endif /* OPENSSL_NO_MD4 */
1105#ifndef OPENSSL_NO_MD5
1106 { 1048 {
1107 .name = SN_md5WithRSAEncryption, 1049 .name = SN_md5WithRSAEncryption,
1108 .digest = EVP_md5, 1050 .digest = EVP_md5,
1109 .alias = SN_md5, 1051 .alias = SN_md5,
1110 }, 1052 },
1111#endif /* OPENSSL_NO_MD5 */
1112#ifndef OPENSSL_NO_RIPEMD
1113 { 1053 {
1114 .name = SN_ripemd160WithRSA, 1054 .name = SN_ripemd160WithRSA,
1115 .digest = EVP_ripemd160, 1055 .digest = EVP_ripemd160,
1116 .alias = SN_ripemd160, 1056 .alias = SN_ripemd160,
1117 }, 1057 },
1118#endif /* OPENSSL_NO_RIPEMD */
1119#ifndef OPENSSL_NO_SHA1
1120 { 1058 {
1121 .name = SN_sha1WithRSAEncryption, 1059 .name = SN_sha1WithRSAEncryption,
1122 .digest = EVP_sha1, 1060 .digest = EVP_sha1,
@@ -1127,8 +1065,6 @@ static const struct digest_name digest_names[] = {
1127 .digest = EVP_sha1, 1065 .digest = EVP_sha1,
1128 .alias = SN_sha1, /* XXX - alias to SN_sha1WithRSAEncryption? */ 1066 .alias = SN_sha1, /* XXX - alias to SN_sha1WithRSAEncryption? */
1129 }, 1067 },
1130#endif /* OPENSSL_NO_SHA1 */
1131#ifndef OPENSSL_NO_SHA256
1132 { 1068 {
1133 .name = SN_sha224WithRSAEncryption, 1069 .name = SN_sha224WithRSAEncryption,
1134 .digest = EVP_sha224, 1070 .digest = EVP_sha224,
@@ -1139,8 +1075,6 @@ static const struct digest_name digest_names[] = {
1139 .digest = EVP_sha256, 1075 .digest = EVP_sha256,
1140 .alias = SN_sha256, 1076 .alias = SN_sha256,
1141 }, 1077 },
1142#endif /* OPENSSL_NO_SHA256 */
1143#ifndef OPENSSL_NO_SHA3
1144 { 1078 {
1145 .name = LN_RSA_SHA3_224, 1079 .name = LN_RSA_SHA3_224,
1146 .digest = EVP_sha3_224, 1080 .digest = EVP_sha3_224,
@@ -1161,8 +1095,6 @@ static const struct digest_name digest_names[] = {
1161 .digest = EVP_sha3_512, 1095 .digest = EVP_sha3_512,
1162 .alias = SN_sha3_512, 1096 .alias = SN_sha3_512,
1163 }, 1097 },
1164#endif /* OPENSSL_NO_SHA3 */
1165#ifndef OPENSSL_NO_SHA512
1166 { 1098 {
1167 .name = SN_sha384WithRSAEncryption, 1099 .name = SN_sha384WithRSAEncryption,
1168 .digest = EVP_sha384, 1100 .digest = EVP_sha384,
@@ -1183,23 +1115,16 @@ static const struct digest_name digest_names[] = {
1183 .digest = EVP_sha512_256, 1115 .digest = EVP_sha512_256,
1184 .alias = SN_sha512_256, 1116 .alias = SN_sha512_256,
1185 }, 1117 },
1186#endif /* OPENSSL_NO_SHA256 */
1187#ifndef OPENSSL_NO_SM4
1188 { 1118 {
1189 .name = SN_sm3WithRSAEncryption, 1119 .name = SN_sm3WithRSAEncryption,
1190 .digest = EVP_sm3, 1120 .digest = EVP_sm3,
1191 .alias = SN_sm3, 1121 .alias = SN_sm3,
1192 }, 1122 },
1193#endif
1194#endif /* OPENSSL_NO_RSA */
1195 1123
1196#ifndef OPENSSL_NO_SHA1
1197 { 1124 {
1198 .name = SN_sha1, 1125 .name = SN_sha1,
1199 .digest = EVP_sha1, 1126 .digest = EVP_sha1,
1200 }, 1127 },
1201#endif /* OPENSSL_NO_SHA1 */
1202#ifndef OPENSSL_NO_SHA256
1203 { 1128 {
1204 .name = SN_sha224, 1129 .name = SN_sha224,
1205 .digest = EVP_sha224, 1130 .digest = EVP_sha224,
@@ -1208,8 +1133,6 @@ static const struct digest_name digest_names[] = {
1208 .name = SN_sha256, 1133 .name = SN_sha256,
1209 .digest = EVP_sha256, 1134 .digest = EVP_sha256,
1210 }, 1135 },
1211#endif /* OPENSSL_NO_SHA256 */
1212#ifndef OPENSSL_NO_SHA3
1213 { 1136 {
1214 .name = SN_sha3_224, 1137 .name = SN_sha3_224,
1215 .digest = EVP_sha3_224, 1138 .digest = EVP_sha3_224,
@@ -1226,9 +1149,7 @@ static const struct digest_name digest_names[] = {
1226 .name = SN_sha3_512, 1149 .name = SN_sha3_512,
1227 .digest = EVP_sha3_512, 1150 .digest = EVP_sha3_512,
1228 }, 1151 },
1229#endif /* OPENSSL_NO_SHA3 */
1230 1152
1231#ifndef OPENSSL_NO_SHA512
1232 { 1153 {
1233 .name = SN_sha384, 1154 .name = SN_sha384,
1234 .digest = EVP_sha384, 1155 .digest = EVP_sha384,
@@ -1245,24 +1166,18 @@ static const struct digest_name digest_names[] = {
1245 .name = SN_sha512_256, 1166 .name = SN_sha512_256,
1246 .digest = EVP_sha512_256, 1167 .digest = EVP_sha512_256,
1247 }, 1168 },
1248#endif /* OPENSSL_NO_SHA512 */
1249 1169
1250#ifndef OPENSSL_NO_SM3
1251 { 1170 {
1252 .name = SN_sm3, 1171 .name = SN_sm3,
1253 .digest = EVP_sm3, 1172 .digest = EVP_sm3,
1254 }, 1173 },
1255#endif /* OPENSSL_NO_SM3 */
1256 1174
1257#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA1)
1258 { 1175 {
1259 .name = LN_dsaWithSHA1, 1176 .name = LN_dsaWithSHA1,
1260 .digest = EVP_sha1, 1177 .digest = EVP_sha1,
1261 .alias = SN_sha1, 1178 .alias = SN_sha1,
1262 }, 1179 },
1263#endif
1264 1180
1265#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA256)
1266 { 1181 {
1267 .name = LN_dsa_with_SHA224, 1182 .name = LN_dsa_with_SHA224,
1268 .digest = EVP_sha224, 1183 .digest = EVP_sha224,
@@ -1283,17 +1198,13 @@ static const struct digest_name digest_names[] = {
1283 .digest = EVP_sha512, 1198 .digest = EVP_sha512,
1284 .alias = SN_sha512, 1199 .alias = SN_sha512,
1285 }, 1200 },
1286#endif /* OPENSSL_NO_DSA && OPENSSL_NO_SHA256 */
1287 1201
1288#if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_EC)
1289 { 1202 {
1290 .name = SN_ecdsa_with_SHA1, 1203 .name = SN_ecdsa_with_SHA1,
1291 .digest = EVP_sha1, 1204 .digest = EVP_sha1,
1292 .alias = SN_sha1, 1205 .alias = SN_sha1,
1293 }, 1206 },
1294#endif
1295 1207
1296#if !defined(OPENSSL_NO_SHA256) && !defined(OPENSSL_NO_EC)
1297 { 1208 {
1298 .name = SN_ecdsa_with_SHA224, 1209 .name = SN_ecdsa_with_SHA224,
1299 .digest = EVP_sha224, 1210 .digest = EVP_sha224,
@@ -1314,9 +1225,7 @@ static const struct digest_name digest_names[] = {
1314 .digest = EVP_sha512, 1225 .digest = EVP_sha512,
1315 .alias = SN_sha512, 1226 .alias = SN_sha512,
1316 }, 1227 },
1317#endif /* OPENSSL_NO_SHA256 && OPENSSL_NO_EC */
1318 1228
1319#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA256)
1320 { 1229 {
1321 .name = SN_dsa_with_SHA224, 1230 .name = SN_dsa_with_SHA224,
1322 .digest = EVP_sha224, 1231 .digest = EVP_sha224,
@@ -1327,9 +1236,7 @@ static const struct digest_name digest_names[] = {
1327 .digest = EVP_sha256, 1236 .digest = EVP_sha256,
1328 .alias = SN_sha256, 1237 .alias = SN_sha256,
1329 }, 1238 },
1330#endif /* OPENSSL_NO_DSA && OPENSSL_NO_SHA256 */
1331 1239
1332#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA3)
1333 { 1240 {
1334 .name = SN_dsa_with_SHA3_224, 1241 .name = SN_dsa_with_SHA3_224,
1335 .digest = EVP_sha3_224, 1242 .digest = EVP_sha3_224,
@@ -1350,9 +1257,7 @@ static const struct digest_name digest_names[] = {
1350 .digest = EVP_sha3_512, 1257 .digest = EVP_sha3_512,
1351 .alias = SN_sha3_512, 1258 .alias = SN_sha3_512,
1352 }, 1259 },
1353#endif /* OPENSSL_NO_DSA && OPENSSL_NO_SHA3 */
1354 1260
1355#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_SHA256)
1356 { 1261 {
1357 .name = SN_dsa_with_SHA384, 1262 .name = SN_dsa_with_SHA384,
1358 .digest = EVP_sha384, 1263 .digest = EVP_sha384,
@@ -1363,9 +1268,7 @@ static const struct digest_name digest_names[] = {
1363 .digest = EVP_sha512, 1268 .digest = EVP_sha512,
1364 .alias = SN_sha512, 1269 .alias = SN_sha512,
1365 }, 1270 },
1366#endif /* OPENSSL_NO_DSA && OPENSSL_NO_SHA256 */
1367 1271
1368#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_SHA3)
1369 { 1272 {
1370 .name = SN_ecdsa_with_SHA3_224, 1273 .name = SN_ecdsa_with_SHA3_224,
1371 .digest = EVP_sha3_224, 1274 .digest = EVP_sha3_224,
@@ -1386,9 +1289,7 @@ static const struct digest_name digest_names[] = {
1386 .digest = EVP_sha3_512, 1289 .digest = EVP_sha3_512,
1387 .alias = SN_sha3_512, 1290 .alias = SN_sha3_512,
1388 }, 1291 },
1389#endif /* OPENSSL_NO_EC && OPENSSL_NO_SHA3 */
1390 1292
1391#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_SHA3)
1392 { 1293 {
1393 .name = SN_RSA_SHA3_224, 1294 .name = SN_RSA_SHA3_224,
1394 .digest = EVP_sha3_224, 1295 .digest = EVP_sha3_224,
@@ -1409,43 +1310,31 @@ static const struct digest_name digest_names[] = {
1409 .digest = EVP_sha3_512, 1310 .digest = EVP_sha3_512,
1410 .alias = SN_sha3_512, 1311 .alias = SN_sha3_512,
1411 }, 1312 },
1412#endif /* OPENSSL_NO_RSA && OPENSSL_NO_SHA3 */
1413 1313
1414#ifndef OPENSSL_NO_MD4
1415 { 1314 {
1416 .name = LN_md4, 1315 .name = LN_md4,
1417 .digest = EVP_md4, 1316 .digest = EVP_md4,
1418 }, 1317 },
1419#endif /* OPENSSL_NO_MD4 */
1420#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_RSA)
1421 { 1318 {
1422 .name = LN_md4WithRSAEncryption, 1319 .name = LN_md4WithRSAEncryption,
1423 .digest = EVP_md4, 1320 .digest = EVP_md4,
1424 .alias = SN_md4, 1321 .alias = SN_md4,
1425 }, 1322 },
1426#endif /* OPENSSL_NO_MD4 */
1427 1323
1428#if !defined(OPENSSL_NO_MD5)
1429 { 1324 {
1430 .name = LN_md5, 1325 .name = LN_md5,
1431 .digest = EVP_md5, 1326 .digest = EVP_md5,
1432 }, 1327 },
1433#endif /* OPENSSL_NO_MD5 */
1434#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_SHA1)
1435 { 1328 {
1436 .name = LN_md5_sha1, 1329 .name = LN_md5_sha1,
1437 .digest = EVP_md5_sha1, 1330 .digest = EVP_md5_sha1,
1438 }, 1331 },
1439#endif /* OPENSSL_NO_MD5 && OPENSSL_NO_SHA1 */
1440#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_RSA)
1441 { 1332 {
1442 .name = LN_md5WithRSAEncryption, 1333 .name = LN_md5WithRSAEncryption,
1443 .digest = EVP_md5, 1334 .digest = EVP_md5,
1444 .alias = SN_md5, 1335 .alias = SN_md5,
1445 }, 1336 },
1446#endif
1447 1337
1448#ifndef OPENSSL_NO_RIPEMD
1449 { 1338 {
1450 .name = "ripemd", 1339 .name = "ripemd",
1451 .digest = EVP_ripemd160, 1340 .digest = EVP_ripemd160,
@@ -1455,60 +1344,46 @@ static const struct digest_name digest_names[] = {
1455 .name = LN_ripemd160, 1344 .name = LN_ripemd160,
1456 .digest = EVP_ripemd160, 1345 .digest = EVP_ripemd160,
1457 }, 1346 },
1458#ifndef OPENSSL_NO_RSA
1459 { 1347 {
1460 .name = LN_ripemd160WithRSA, 1348 .name = LN_ripemd160WithRSA,
1461 .digest = EVP_ripemd160, 1349 .digest = EVP_ripemd160,
1462 .alias = SN_ripemd160, 1350 .alias = SN_ripemd160,
1463 }, 1351 },
1464#endif /* OPENSSL_NO_RSA */
1465 { 1352 {
1466 .name = "rmd160", 1353 .name = "rmd160",
1467 .digest = EVP_ripemd160, 1354 .digest = EVP_ripemd160,
1468 .alias = SN_ripemd160, 1355 .alias = SN_ripemd160,
1469 }, 1356 },
1470#endif /* OPENSSL_NO_RIPEMD */
1471 1357
1472#ifndef OPENSSL_NO_SHA1
1473 { 1358 {
1474 .name = LN_sha1, 1359 .name = LN_sha1,
1475 .digest = EVP_sha1, 1360 .digest = EVP_sha1,
1476 }, 1361 },
1477#endif /* OPENSSL_NO_SHA1 */
1478#if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_RSA)
1479 { 1362 {
1480 .name = LN_sha1WithRSAEncryption, 1363 .name = LN_sha1WithRSAEncryption,
1481 .digest = EVP_sha1, 1364 .digest = EVP_sha1,
1482 .alias = SN_sha1, 1365 .alias = SN_sha1,
1483 }, 1366 },
1484#endif /* OPENSSL_NO_SHA1 && OPENSSL_NO_RSA */
1485 1367
1486#ifndef OPENSSL_NO_SHA256
1487 { 1368 {
1488 .name = LN_sha224, 1369 .name = LN_sha224,
1489 .digest = EVP_sha224, 1370 .digest = EVP_sha224,
1490 }, 1371 },
1491#ifndef OPENSSL_NO_RSA
1492 { 1372 {
1493 .name = LN_sha224WithRSAEncryption, 1373 .name = LN_sha224WithRSAEncryption,
1494 .digest = EVP_sha224, 1374 .digest = EVP_sha224,
1495 .alias = SN_sha224, 1375 .alias = SN_sha224,
1496 }, 1376 },
1497#endif /* OPENSSL_NO_RSA */
1498 { 1377 {
1499 .name = LN_sha256, 1378 .name = LN_sha256,
1500 .digest = EVP_sha256, 1379 .digest = EVP_sha256,
1501 }, 1380 },
1502#ifndef OPENSSL_NO_RSA
1503 { 1381 {
1504 .name = LN_sha256WithRSAEncryption, 1382 .name = LN_sha256WithRSAEncryption,
1505 .digest = EVP_sha256, 1383 .digest = EVP_sha256,
1506 .alias = SN_sha256, 1384 .alias = SN_sha256,
1507 }, 1385 },
1508#endif /* OPENSSL_NO_RSA */
1509#endif /* OPENSSL_NO_SHA256 */
1510 1386
1511#ifndef OPENSSL_NO_SHA3
1512 { 1387 {
1513 .name = LN_sha3_224, 1388 .name = LN_sha3_224,
1514 .digest = EVP_sha3_224, 1389 .digest = EVP_sha3_224,
@@ -1525,20 +1400,16 @@ static const struct digest_name digest_names[] = {
1525 .name = LN_sha3_512, 1400 .name = LN_sha3_512,
1526 .digest = EVP_sha3_512, 1401 .digest = EVP_sha3_512,
1527 }, 1402 },
1528#endif /* OPENSSL_NO_SHA3 */
1529 1403
1530#ifndef OPENSSL_NO_SHA512
1531 { 1404 {
1532 .name = LN_sha384, 1405 .name = LN_sha384,
1533 .digest = EVP_sha384, 1406 .digest = EVP_sha384,
1534 }, 1407 },
1535#ifndef OPENSSL_NO_RSA
1536 { 1408 {
1537 .name = LN_sha384WithRSAEncryption, 1409 .name = LN_sha384WithRSAEncryption,
1538 .digest = EVP_sha384, 1410 .digest = EVP_sha384,
1539 .alias = SN_sha384, 1411 .alias = SN_sha384,
1540 }, 1412 },
1541#endif /* OPENSSL_NO_RSA */
1542 { 1413 {
1543 .name = LN_sha512, 1414 .name = LN_sha512,
1544 .digest = EVP_sha512, 1415 .digest = EVP_sha512,
@@ -1547,18 +1418,15 @@ static const struct digest_name digest_names[] = {
1547 .name = LN_sha512_224, 1418 .name = LN_sha512_224,
1548 .digest = EVP_sha512_224, 1419 .digest = EVP_sha512_224,
1549 }, 1420 },
1550#ifndef OPENSSL_NO_RSA
1551 { 1421 {
1552 .name = LN_sha512_224WithRSAEncryption, 1422 .name = LN_sha512_224WithRSAEncryption,
1553 .digest = EVP_sha512_224, 1423 .digest = EVP_sha512_224,
1554 .alias = SN_sha512_224, 1424 .alias = SN_sha512_224,
1555 }, 1425 },
1556#endif
1557 { 1426 {
1558 .name = LN_sha512_256, 1427 .name = LN_sha512_256,
1559 .digest = EVP_sha512_256, 1428 .digest = EVP_sha512_256,
1560 }, 1429 },
1561#ifndef OPENSSL_NO_RSA
1562 { 1430 {
1563 .name = LN_sha512_256WithRSAEncryption, 1431 .name = LN_sha512_256WithRSAEncryption,
1564 .digest = EVP_sha512_256, 1432 .digest = EVP_sha512_256,
@@ -1569,24 +1437,17 @@ static const struct digest_name digest_names[] = {
1569 .digest = EVP_sha512, 1437 .digest = EVP_sha512,
1570 .alias = SN_sha512, 1438 .alias = SN_sha512,
1571 }, 1439 },
1572#endif
1573#endif /* OPENSSL_NO_SHA512 */
1574 1440
1575#ifndef OPENSSL_NO_SM3
1576 { 1441 {
1577 .name = LN_sm3, 1442 .name = LN_sm3,
1578 .digest = EVP_sm3, 1443 .digest = EVP_sm3,
1579 }, 1444 },
1580#endif /* OPENSSL_NO_SM3 */
1581#if !defined(OPENSSL_NO_SM3) && !defined(OPENSSL_NO_RSA)
1582 { 1445 {
1583 .name = LN_sm3WithRSAEncryption, 1446 .name = LN_sm3WithRSAEncryption,
1584 .digest = EVP_sm3, 1447 .digest = EVP_sm3,
1585 .alias = SN_sm3, 1448 .alias = SN_sm3,
1586 }, 1449 },
1587#endif /* OPENSSL_NO_SM3 && OPENSSL_NO_RSA */
1588 1450
1589#ifndef OPENSSL_NO_MD5
1590 { 1451 {
1591 .name = "ssl2-md5", 1452 .name = "ssl2-md5",
1592 .digest = EVP_md5, 1453 .digest = EVP_md5,
@@ -1597,22 +1458,17 @@ static const struct digest_name digest_names[] = {
1597 .digest = EVP_md5, 1458 .digest = EVP_md5,
1598 .alias = SN_md5, 1459 .alias = SN_md5,
1599 }, 1460 },
1600#endif /* OPENSSL_NO_MD5 */
1601 1461
1602#ifndef OPENSSL_NO_SHA1
1603 { 1462 {
1604 .name = "ssl3-sha1", 1463 .name = "ssl3-sha1",
1605 .digest = EVP_sha1, 1464 .digest = EVP_sha1,
1606 .alias = SN_sha1, 1465 .alias = SN_sha1,
1607 }, 1466 },
1608#endif /* OPENSSL_NO_SHA1 */
1609 1467
1610#ifndef OPENSSL_NO_WHIRLPOOL
1611 { 1468 {
1612 .name = SN_whirlpool, 1469 .name = SN_whirlpool,
1613 .digest = EVP_whirlpool, 1470 .digest = EVP_whirlpool,
1614 }, 1471 },
1615#endif
1616}; 1472};
1617 1473
1618#define N_DIGEST_NAMES (sizeof(digest_names) / sizeof(digest_names[0])) 1474#define N_DIGEST_NAMES (sizeof(digest_names) / sizeof(digest_names[0]))