Lines Matching full:oid
210 if (asn1_get_oid(pos, end - pos, &id->oid, &pos)) in x509_parse_algorithm_identifier()
297 struct asn1_oid oid; in x509_parse_name() local
356 if (asn1_get_oid(seq_pos, seq_end - seq_pos, &oid, &seq_pos)) { in x509_parse_name()
378 if (oid.len == 4 && in x509_parse_name()
379 oid.oid[0] == 2 && oid.oid[1] == 5 && oid.oid[2] == 4) { in x509_parse_name()
381 switch (oid.oid[3]) { in x509_parse_name()
407 } else if (oid.len == 7 && in x509_parse_name()
408 oid.oid[0] == 1 && oid.oid[1] == 2 && in x509_parse_name()
409 oid.oid[2] == 840 && oid.oid[3] == 113549 && in x509_parse_name()
410 oid.oid[4] == 1 && oid.oid[5] == 9 && in x509_parse_name()
411 oid.oid[6] == 1) { in x509_parse_name()
422 } else if (oid.len == 7 && in x509_parse_name()
423 oid.oid[0] == 0 && oid.oid[1] == 9 && in x509_parse_name()
424 oid.oid[2] == 2342 && oid.oid[3] == 19200300 && in x509_parse_name()
425 oid.oid[4] == 100 && oid.oid[5] == 1 && in x509_parse_name()
426 oid.oid[6] == 25) { in x509_parse_name()
432 wpa_hexdump(MSG_DEBUG, "X509: Unrecognized OID", in x509_parse_name()
433 (u8 *) oid.oid, in x509_parse_name()
434 oid.len * sizeof(oid.oid[0])); in x509_parse_name()
757 static int x509_id_ce_oid(struct asn1_oid *oid) in x509_id_ce_oid() argument
760 return oid->len >= 4 && in x509_id_ce_oid()
761 oid->oid[0] == 2 /* joint-iso-ccitt */ && in x509_id_ce_oid()
762 oid->oid[1] == 5 /* ds */ && in x509_id_ce_oid()
763 oid->oid[2] == 29 /* id-ce */; in x509_id_ce_oid()
767 static int x509_any_ext_key_usage_oid(struct asn1_oid *oid) in x509_any_ext_key_usage_oid() argument
769 return oid->len == 6 && in x509_any_ext_key_usage_oid()
770 x509_id_ce_oid(oid) && in x509_any_ext_key_usage_oid()
771 oid->oid[3] == 37 /* extKeyUsage */ && in x509_any_ext_key_usage_oid()
772 oid->oid[4] == 0 /* anyExtendedKeyUsage */; in x509_any_ext_key_usage_oid()
1124 static int x509_id_cert_policy_any_oid(struct asn1_oid *oid) in x509_id_cert_policy_any_oid() argument
1126 return oid->len == 5 && in x509_id_cert_policy_any_oid()
1127 oid->oid[0] == 2 /* iso/itu-t */ && in x509_id_cert_policy_any_oid()
1128 oid->oid[1] == 5 /* X.500 Directory Services */ && in x509_id_cert_policy_any_oid()
1129 oid->oid[2] == 29 /* id-ce */ && in x509_id_cert_policy_any_oid()
1130 oid->oid[3] == 32 /* id-ce-certificate-policies */ && in x509_id_cert_policy_any_oid()
1131 oid->oid[4] == 0 /* anyPolicy */; in x509_id_cert_policy_any_oid()
1135 static int x509_id_wfa_oid(struct asn1_oid *oid) in x509_id_wfa_oid() argument
1137 return oid->len >= 7 && in x509_id_wfa_oid()
1138 oid->oid[0] == 1 /* iso */ && in x509_id_wfa_oid()
1139 oid->oid[1] == 3 /* identified-organization */ && in x509_id_wfa_oid()
1140 oid->oid[2] == 6 /* dod */ && in x509_id_wfa_oid()
1141 oid->oid[3] == 1 /* internet */ && in x509_id_wfa_oid()
1142 oid->oid[4] == 4 /* private */ && in x509_id_wfa_oid()
1143 oid->oid[5] == 1 /* enterprise */ && in x509_id_wfa_oid()
1144 oid->oid[6] == 40808 /* WFA */; in x509_id_wfa_oid()
1148 static int x509_id_wfa_tod_oid(struct asn1_oid *oid) in x509_id_wfa_tod_oid() argument
1150 return oid->len >= 9 && in x509_id_wfa_tod_oid()
1151 x509_id_wfa_oid(oid) && in x509_id_wfa_tod_oid()
1152 oid->oid[7] == 1 && in x509_id_wfa_tod_oid()
1153 oid->oid[8] == 3; in x509_id_wfa_tod_oid()
1157 static int x509_id_wfa_tod_strict_oid(struct asn1_oid *oid) in x509_id_wfa_tod_strict_oid() argument
1159 return oid->len == 10 && in x509_id_wfa_tod_strict_oid()
1160 x509_id_wfa_tod_oid(oid) && in x509_id_wfa_tod_strict_oid()
1161 oid->oid[9] == 1; in x509_id_wfa_tod_strict_oid()
1165 static int x509_id_wfa_tod_tofu_oid(struct asn1_oid *oid) in x509_id_wfa_tod_tofu_oid() argument
1167 return oid->len == 10 && in x509_id_wfa_tod_tofu_oid()
1168 x509_id_wfa_tod_oid(oid) && in x509_id_wfa_tod_tofu_oid()
1169 oid->oid[9] == 2; in x509_id_wfa_tod_tofu_oid()
1206 struct asn1_oid oid; in x509_parse_ext_certificate_policies() local
1223 if (asn1_get_oid(pos, pol_end - pos, &oid, &pos)) in x509_parse_ext_certificate_policies()
1225 if (x509_id_cert_policy_any_oid(&oid)) { in x509_parse_ext_certificate_policies()
1229 } else if (x509_id_wfa_tod_strict_oid(&oid)) { in x509_parse_ext_certificate_policies()
1233 } else if (x509_id_wfa_tod_tofu_oid(&oid)) { in x509_parse_ext_certificate_policies()
1238 asn1_oid_to_str(&oid, buf, sizeof(buf)); in x509_parse_ext_certificate_policies()
1251 static int x509_id_pkix_oid(struct asn1_oid *oid) in x509_id_pkix_oid() argument
1253 return oid->len >= 7 && in x509_id_pkix_oid()
1254 oid->oid[0] == 1 /* iso */ && in x509_id_pkix_oid()
1255 oid->oid[1] == 3 /* identified-organization */ && in x509_id_pkix_oid()
1256 oid->oid[2] == 6 /* dod */ && in x509_id_pkix_oid()
1257 oid->oid[3] == 1 /* internet */ && in x509_id_pkix_oid()
1258 oid->oid[4] == 5 /* security */ && in x509_id_pkix_oid()
1259 oid->oid[5] == 5 /* mechanisms */ && in x509_id_pkix_oid()
1260 oid->oid[6] == 7 /* id-pkix */; in x509_id_pkix_oid()
1264 static int x509_id_kp_oid(struct asn1_oid *oid) in x509_id_kp_oid() argument
1267 return oid->len >= 8 && in x509_id_kp_oid()
1268 x509_id_pkix_oid(oid) && in x509_id_kp_oid()
1269 oid->oid[7] == 3 /* id-kp */; in x509_id_kp_oid()
1273 static int x509_id_kp_server_auth_oid(struct asn1_oid *oid) in x509_id_kp_server_auth_oid() argument
1276 return oid->len == 9 && in x509_id_kp_server_auth_oid()
1277 x509_id_kp_oid(oid) && in x509_id_kp_server_auth_oid()
1278 oid->oid[8] == 1 /* id-kp-serverAuth */; in x509_id_kp_server_auth_oid()
1282 static int x509_id_kp_client_auth_oid(struct asn1_oid *oid) in x509_id_kp_client_auth_oid() argument
1285 return oid->len == 9 && in x509_id_kp_client_auth_oid()
1286 x509_id_kp_oid(oid) && in x509_id_kp_client_auth_oid()
1287 oid->oid[8] == 2 /* id-kp-clientAuth */; in x509_id_kp_client_auth_oid()
1291 static int x509_id_kp_ocsp_oid(struct asn1_oid *oid) in x509_id_kp_ocsp_oid() argument
1294 return oid->len == 9 && in x509_id_kp_ocsp_oid()
1295 x509_id_kp_oid(oid) && in x509_id_kp_ocsp_oid()
1296 oid->oid[8] == 9 /* id-kp-OCSPSigning */; in x509_id_kp_ocsp_oid()
1305 struct asn1_oid oid; in x509_parse_ext_ext_key_usage() local
1331 if (asn1_get_oid(pos, end - pos, &oid, &pos)) in x509_parse_ext_ext_key_usage()
1333 if (x509_any_ext_key_usage_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1336 } else if (x509_id_kp_server_auth_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1339 } else if (x509_id_kp_client_auth_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1342 } else if (x509_id_kp_ocsp_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1346 asn1_oid_to_str(&oid, buf, sizeof(buf)); in x509_parse_ext_ext_key_usage()
1358 struct asn1_oid *oid, in x509_parse_extension_data() argument
1361 if (!x509_id_ce_oid(oid)) in x509_parse_extension_data()
1369 switch (oid->oid[3]) { in x509_parse_extension_data()
1393 struct asn1_oid oid; in x509_parse_extension() local
1416 if (asn1_get_oid(pos, end - pos, &oid, &pos) < 0) { in x509_parse_extension()
1418 "Extension (expected OID)"); in x509_parse_extension()
1447 asn1_oid_to_str(&oid, buf, sizeof(buf)); in x509_parse_extension()
1452 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length); in x509_parse_extension()
1700 static int x509_rsadsi_oid(struct asn1_oid *oid) in x509_rsadsi_oid() argument
1702 return oid->len >= 4 && in x509_rsadsi_oid()
1703 oid->oid[0] == 1 /* iso */ && in x509_rsadsi_oid()
1704 oid->oid[1] == 2 /* member-body */ && in x509_rsadsi_oid()
1705 oid->oid[2] == 840 /* us */ && in x509_rsadsi_oid()
1706 oid->oid[3] == 113549 /* rsadsi */; in x509_rsadsi_oid()
1710 static int x509_pkcs_oid(struct asn1_oid *oid) in x509_pkcs_oid() argument
1712 return oid->len >= 5 && in x509_pkcs_oid()
1713 x509_rsadsi_oid(oid) && in x509_pkcs_oid()
1714 oid->oid[4] == 1 /* pkcs */; in x509_pkcs_oid()
1718 static int x509_digest_oid(struct asn1_oid *oid) in x509_digest_oid() argument
1720 return oid->len >= 5 && in x509_digest_oid()
1721 x509_rsadsi_oid(oid) && in x509_digest_oid()
1722 oid->oid[4] == 2 /* digestAlgorithm */; in x509_digest_oid()
1726 int x509_sha1_oid(struct asn1_oid *oid) in x509_sha1_oid() argument
1728 return oid->len == 6 && in x509_sha1_oid()
1729 oid->oid[0] == 1 /* iso */ && in x509_sha1_oid()
1730 oid->oid[1] == 3 /* identified-organization */ && in x509_sha1_oid()
1731 oid->oid[2] == 14 /* oiw */ && in x509_sha1_oid()
1732 oid->oid[3] == 3 /* secsig */ && in x509_sha1_oid()
1733 oid->oid[4] == 2 /* algorithms */ && in x509_sha1_oid()
1734 oid->oid[5] == 26 /* id-sha1 */; in x509_sha1_oid()
1738 static int x509_sha2_oid(struct asn1_oid *oid) in x509_sha2_oid() argument
1740 return oid->len == 9 && in x509_sha2_oid()
1741 oid->oid[0] == 2 /* joint-iso-itu-t */ && in x509_sha2_oid()
1742 oid->oid[1] == 16 /* country */ && in x509_sha2_oid()
1743 oid->oid[2] == 840 /* us */ && in x509_sha2_oid()
1744 oid->oid[3] == 1 /* organization */ && in x509_sha2_oid()
1745 oid->oid[4] == 101 /* gov */ && in x509_sha2_oid()
1746 oid->oid[5] == 3 /* csor */ && in x509_sha2_oid()
1747 oid->oid[6] == 4 /* nistAlgorithm */ && in x509_sha2_oid()
1748 oid->oid[7] == 2 /* hashAlgs */; in x509_sha2_oid()
1752 int x509_sha256_oid(struct asn1_oid *oid) in x509_sha256_oid() argument
1754 return x509_sha2_oid(oid) && in x509_sha256_oid()
1755 oid->oid[8] == 1 /* sha256 */; in x509_sha256_oid()
1759 int x509_sha384_oid(struct asn1_oid *oid) in x509_sha384_oid() argument
1761 return x509_sha2_oid(oid) && in x509_sha384_oid()
1762 oid->oid[8] == 2 /* sha384 */; in x509_sha384_oid()
1766 int x509_sha512_oid(struct asn1_oid *oid) in x509_sha512_oid() argument
1768 return x509_sha2_oid(oid) && in x509_sha512_oid()
1769 oid->oid[8] == 3 /* sha512 */; in x509_sha512_oid()
1907 struct asn1_oid oid; in x509_check_signature() local
1913 if (!x509_pkcs_oid(&signature->oid) || in x509_check_signature()
1914 signature->oid.len != 7 || in x509_check_signature()
1915 signature->oid.oid[5] != 1 /* pkcs-1 */) { in x509_check_signature()
1990 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { in x509_check_signature()
1996 if (x509_sha1_oid(&oid)) { in x509_check_signature()
1997 if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) { in x509_check_signature()
2001 signature->oid.oid[6]); in x509_check_signature()
2008 if (x509_sha256_oid(&oid)) { in x509_check_signature()
2009 if (signature->oid.oid[6] != in x509_check_signature()
2014 signature->oid.oid[6]); in x509_check_signature()
2021 if (x509_sha384_oid(&oid)) { in x509_check_signature()
2022 if (signature->oid.oid[6] != 12 /* sha384WithRSAEncryption */) { in x509_check_signature()
2026 signature->oid.oid[6]); in x509_check_signature()
2033 if (x509_sha512_oid(&oid)) { in x509_check_signature()
2034 if (signature->oid.oid[6] != 13 /* sha512WithRSAEncryption */) { in x509_check_signature()
2038 signature->oid.oid[6]); in x509_check_signature()
2045 if (!x509_digest_oid(&oid)) { in x509_check_signature()
2050 switch (oid.oid[5]) { in x509_check_signature()
2052 if (signature->oid.oid[6] != 4 /* md5WithRSAEncryption */) { in x509_check_signature()
2056 signature->oid.oid[6]); in x509_check_signature()
2065 "(%lu)", oid.oid[5]); in x509_check_signature()
2087 switch (signature->oid.oid[6]) { in x509_check_signature()
2121 "algorithm (%lu)", signature->oid.oid[6]); in x509_check_signature()