Lines Matching refs: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()
433 (u8 *) oid.oid, in x509_parse_name()
434 oid.len * sizeof(oid.oid[0])); in x509_parse_name()
713 static int x509_id_ce_oid(struct asn1_oid *oid) in x509_id_ce_oid() argument
716 return oid->len >= 4 && in x509_id_ce_oid()
717 oid->oid[0] == 2 /* joint-iso-ccitt */ && in x509_id_ce_oid()
718 oid->oid[1] == 5 /* ds */ && in x509_id_ce_oid()
719 oid->oid[2] == 29 /* id-ce */; in x509_id_ce_oid()
723 static int x509_any_ext_key_usage_oid(struct asn1_oid *oid) in x509_any_ext_key_usage_oid() argument
725 return oid->len == 6 && in x509_any_ext_key_usage_oid()
726 x509_id_ce_oid(oid) && in x509_any_ext_key_usage_oid()
727 oid->oid[3] == 37 /* extKeyUsage */ && in x509_any_ext_key_usage_oid()
728 oid->oid[4] == 0 /* anyExtendedKeyUsage */; in x509_any_ext_key_usage_oid()
1085 static int x509_id_pkix_oid(struct asn1_oid *oid) in x509_id_pkix_oid() argument
1087 return oid->len >= 7 && in x509_id_pkix_oid()
1088 oid->oid[0] == 1 /* iso */ && in x509_id_pkix_oid()
1089 oid->oid[1] == 3 /* identified-organization */ && in x509_id_pkix_oid()
1090 oid->oid[2] == 6 /* dod */ && in x509_id_pkix_oid()
1091 oid->oid[3] == 1 /* internet */ && in x509_id_pkix_oid()
1092 oid->oid[4] == 5 /* security */ && in x509_id_pkix_oid()
1093 oid->oid[5] == 5 /* mechanisms */ && in x509_id_pkix_oid()
1094 oid->oid[6] == 7 /* id-pkix */; in x509_id_pkix_oid()
1098 static int x509_id_kp_oid(struct asn1_oid *oid) in x509_id_kp_oid() argument
1101 return oid->len >= 8 && in x509_id_kp_oid()
1102 x509_id_pkix_oid(oid) && in x509_id_kp_oid()
1103 oid->oid[7] == 3 /* id-kp */; in x509_id_kp_oid()
1107 static int x509_id_kp_server_auth_oid(struct asn1_oid *oid) in x509_id_kp_server_auth_oid() argument
1110 return oid->len == 9 && in x509_id_kp_server_auth_oid()
1111 x509_id_kp_oid(oid) && in x509_id_kp_server_auth_oid()
1112 oid->oid[8] == 1 /* id-kp-serverAuth */; in x509_id_kp_server_auth_oid()
1116 static int x509_id_kp_client_auth_oid(struct asn1_oid *oid) in x509_id_kp_client_auth_oid() argument
1119 return oid->len == 9 && in x509_id_kp_client_auth_oid()
1120 x509_id_kp_oid(oid) && in x509_id_kp_client_auth_oid()
1121 oid->oid[8] == 2 /* id-kp-clientAuth */; in x509_id_kp_client_auth_oid()
1125 static int x509_id_kp_ocsp_oid(struct asn1_oid *oid) in x509_id_kp_ocsp_oid() argument
1128 return oid->len == 9 && in x509_id_kp_ocsp_oid()
1129 x509_id_kp_oid(oid) && in x509_id_kp_ocsp_oid()
1130 oid->oid[8] == 9 /* id-kp-OCSPSigning */; in x509_id_kp_ocsp_oid()
1139 struct asn1_oid oid; in x509_parse_ext_ext_key_usage() local
1165 if (asn1_get_oid(pos, end - pos, &oid, &pos)) in x509_parse_ext_ext_key_usage()
1167 if (x509_any_ext_key_usage_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1170 } else if (x509_id_kp_server_auth_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1173 } else if (x509_id_kp_client_auth_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1176 } else if (x509_id_kp_ocsp_oid(&oid)) { in x509_parse_ext_ext_key_usage()
1180 asn1_oid_to_str(&oid, buf, sizeof(buf)); in x509_parse_ext_ext_key_usage()
1192 struct asn1_oid *oid, in x509_parse_extension_data() argument
1195 if (!x509_id_ce_oid(oid)) in x509_parse_extension_data()
1204 switch (oid->oid[3]) { in x509_parse_extension_data()
1226 struct asn1_oid oid; in x509_parse_extension() local
1249 if (asn1_get_oid(pos, end - pos, &oid, &pos) < 0) { in x509_parse_extension()
1285 asn1_oid_to_str(&oid, buf, sizeof(buf)); in x509_parse_extension()
1290 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length); in x509_parse_extension()
1538 static int x509_rsadsi_oid(struct asn1_oid *oid) in x509_rsadsi_oid() argument
1540 return oid->len >= 4 && in x509_rsadsi_oid()
1541 oid->oid[0] == 1 /* iso */ && in x509_rsadsi_oid()
1542 oid->oid[1] == 2 /* member-body */ && in x509_rsadsi_oid()
1543 oid->oid[2] == 840 /* us */ && in x509_rsadsi_oid()
1544 oid->oid[3] == 113549 /* rsadsi */; in x509_rsadsi_oid()
1548 static int x509_pkcs_oid(struct asn1_oid *oid) in x509_pkcs_oid() argument
1550 return oid->len >= 5 && in x509_pkcs_oid()
1551 x509_rsadsi_oid(oid) && in x509_pkcs_oid()
1552 oid->oid[4] == 1 /* pkcs */; in x509_pkcs_oid()
1556 static int x509_digest_oid(struct asn1_oid *oid) in x509_digest_oid() argument
1558 return oid->len >= 5 && in x509_digest_oid()
1559 x509_rsadsi_oid(oid) && in x509_digest_oid()
1560 oid->oid[4] == 2 /* digestAlgorithm */; in x509_digest_oid()
1564 int x509_sha1_oid(struct asn1_oid *oid) in x509_sha1_oid() argument
1566 return oid->len == 6 && in x509_sha1_oid()
1567 oid->oid[0] == 1 /* iso */ && in x509_sha1_oid()
1568 oid->oid[1] == 3 /* identified-organization */ && in x509_sha1_oid()
1569 oid->oid[2] == 14 /* oiw */ && in x509_sha1_oid()
1570 oid->oid[3] == 3 /* secsig */ && in x509_sha1_oid()
1571 oid->oid[4] == 2 /* algorithms */ && in x509_sha1_oid()
1572 oid->oid[5] == 26 /* id-sha1 */; in x509_sha1_oid()
1576 static int x509_sha2_oid(struct asn1_oid *oid) in x509_sha2_oid() argument
1578 return oid->len == 9 && in x509_sha2_oid()
1579 oid->oid[0] == 2 /* joint-iso-itu-t */ && in x509_sha2_oid()
1580 oid->oid[1] == 16 /* country */ && in x509_sha2_oid()
1581 oid->oid[2] == 840 /* us */ && in x509_sha2_oid()
1582 oid->oid[3] == 1 /* organization */ && in x509_sha2_oid()
1583 oid->oid[4] == 101 /* gov */ && in x509_sha2_oid()
1584 oid->oid[5] == 3 /* csor */ && in x509_sha2_oid()
1585 oid->oid[6] == 4 /* nistAlgorithm */ && in x509_sha2_oid()
1586 oid->oid[7] == 2 /* hashAlgs */; in x509_sha2_oid()
1590 int x509_sha256_oid(struct asn1_oid *oid) in x509_sha256_oid() argument
1592 return x509_sha2_oid(oid) && in x509_sha256_oid()
1593 oid->oid[8] == 1 /* sha256 */; in x509_sha256_oid()
1597 int x509_sha384_oid(struct asn1_oid *oid) in x509_sha384_oid() argument
1599 return x509_sha2_oid(oid) && in x509_sha384_oid()
1600 oid->oid[8] == 2 /* sha384 */; in x509_sha384_oid()
1604 int x509_sha512_oid(struct asn1_oid *oid) in x509_sha512_oid() argument
1606 return x509_sha2_oid(oid) && in x509_sha512_oid()
1607 oid->oid[8] == 3 /* sha512 */; in x509_sha512_oid()
1745 struct asn1_oid oid; in x509_check_signature() local
1751 if (!x509_pkcs_oid(&signature->oid) || in x509_check_signature()
1752 signature->oid.len != 7 || in x509_check_signature()
1753 signature->oid.oid[5] != 1 /* pkcs-1 */) { in x509_check_signature()
1828 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { in x509_check_signature()
1834 if (x509_sha1_oid(&oid)) { in x509_check_signature()
1835 if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) { in x509_check_signature()
1839 signature->oid.oid[6]); in x509_check_signature()
1846 if (x509_sha256_oid(&oid)) { in x509_check_signature()
1847 if (signature->oid.oid[6] != in x509_check_signature()
1852 signature->oid.oid[6]); in x509_check_signature()
1859 if (x509_sha384_oid(&oid)) { in x509_check_signature()
1860 if (signature->oid.oid[6] != 12 /* sha384WithRSAEncryption */) { in x509_check_signature()
1864 signature->oid.oid[6]); in x509_check_signature()
1871 if (x509_sha512_oid(&oid)) { in x509_check_signature()
1872 if (signature->oid.oid[6] != 13 /* sha512WithRSAEncryption */) { in x509_check_signature()
1876 signature->oid.oid[6]); in x509_check_signature()
1883 if (!x509_digest_oid(&oid)) { in x509_check_signature()
1888 switch (oid.oid[5]) { in x509_check_signature()
1890 if (signature->oid.oid[6] != 4 /* md5WithRSAEncryption */) { in x509_check_signature()
1894 signature->oid.oid[6]); in x509_check_signature()
1903 "(%lu)", oid.oid[5]); in x509_check_signature()
1925 switch (signature->oid.oid[6]) { in x509_check_signature()
1959 "algorithm (%lu)", signature->oid.oid[6]); in x509_check_signature()