Home | History | Annotate | Download | only in tls

Lines Matching refs:oid

210 	if (asn1_get_oid(pos, end - pos, &id->oid, &pos))
296 struct asn1_oid oid;
355 if (asn1_get_oid(seq_pos, seq_end - seq_pos, &oid, &seq_pos)) {
377 if (oid.len == 4 &&
378 oid.oid[0] == 2 && oid.oid[1] == 5 && oid.oid[2] == 4) {
380 switch (oid.oid[3]) {
406 } else if (oid.len == 7 &&
407 oid.oid[0] == 1 && oid.oid[1] == 2 &&
408 oid.oid[2] == 840 && oid.oid[3] == 113549 &&
409 oid.oid[4] == 1 && oid.oid[5] == 9 &&
410 oid.oid[6] == 1) {
421 } else if (oid.len == 7 &&
422 oid.oid[0] == 0 && oid.oid[1] == 9 &&
423 oid.oid[2] == 2342 && oid.oid[3] == 19200300 &&
424 oid.oid[4] == 100 && oid.oid[5] == 1 &&
425 oid.oid[6] == 25) {
431 wpa_hexdump(MSG_DEBUG, "X509: Unrecognized OID",
432 (u8 *) oid.oid,
433 oid.len * sizeof(oid.oid[0]));
712 static int x509_id_ce_oid(struct asn1_oid *oid)
715 return oid->len >= 4 &&
716 oid->oid
717 oid->oid[1] == 5 /* ds */ &&
718 oid->oid[2] == 29 /* id-ce */;
722 static int x509_any_ext_key_usage_oid(struct asn1_oid *oid)
724 return oid->len == 6 &&
725 x509_id_ce_oid(oid) &&
726 oid->oid[3] == 37 /* extKeyUsage */ &&
727 oid->oid[4] == 0 /* anyExtendedKeyUsage */;
1083 static int x509_id_pkix_oid(struct asn1_oid *oid)
1085 return oid->len >= 7 &&
1086 oid->oid[0] == 1 /* iso */ &&
1087 oid->oid[1] == 3 /* identified-organization */ &&
1088 oid->oid[2] == 6 /* dod */ &&
1089 oid->oid[3] == 1 /* internet */ &&
1090 oid->oid[4] == 5 /* security */ &&
1091 oid->oid[5] == 5 /* mechanisms */ &&
1092 oid->oid[6] == 7 /* id-pkix */;
1096 static int x509_id_kp_oid(struct asn1_oid *oid)
1099 return oid->len >= 8 &&
1100 x509_id_pkix_oid(oid) &&
1101 oid->oid[7] == 3 /* id-kp */;
1105 static int x509_id_kp_server_auth_oid(struct asn1_oid *oid)
1108 return oid->len == 9 &&
1109 x509_id_kp_oid(oid) &&
1110 oid->oid[8] == 1 /* id-kp-serverAuth */;
1114 static int x509_id_kp_client_auth_oid(struct asn1_oid *oid)
1117 return oid->len == 9 &&
1118 x509_id_kp_oid(oid) &&
1119 oid->oid[8] == 2 /* id-kp-clientAuth */;
1123 static int x509_id_kp_ocsp_oid(struct asn1_oid *oid)
1126 return oid->len == 9 &&
1127 x509_id_kp_oid(oid) &&
1128 oid->oid[8] == 9 /* id-kp-OCSPSigning */;
1137 struct asn1_oid oid;
1163 if (asn1_get_oid(pos, end - pos, &oid, &pos))
1165 if (x509_any_ext_key_usage_oid(&oid)) {
1168 } else if (x509_id_kp_server_auth_oid(&oid)) {
1171 } else if (x509_id_kp_client_auth_oid(&oid)) {
1174 } else if (x509_id_kp_ocsp_oid(&oid)) {
1178 asn1_oid_to_str(&oid, buf, sizeof(buf));
1190 struct asn1_oid *oid,
1193 if (!x509_id_ce_oid(oid))
1202 switch (oid->oid[3]) {
1224 struct asn1_oid oid;
1247 if (asn1_get_oid(pos, end - pos, &oid, &pos) < 0) {
1249 "Extension (expected OID)");
1283 asn1_oid_to_str(&oid, buf, sizeof(buf));
1288 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1536 static int x509_rsadsi_oid(struct asn1_oid *oid)
1538 return oid->len >= 4 &&
1539 oid->oid[0] == 1 /* iso */ &&
1540 oid->oid[1] == 2 /* member-body */ &&
1541 oid->oid[2] == 840 /* us */ &&
1542 oid->oid[3] == 113549 /* rsadsi */;
1546 static int x509_pkcs_oid(struct asn1_oid *oid)
1548 return oid->len >= 5 &&
1549 x509_rsadsi_oid(oid) &&
1550 oid->oid[4] == 1 /* pkcs */;
1554 static int x509_digest_oid(struct asn1_oid *oid)
1556 return oid->len >= 5 &&
1557 x509_rsadsi_oid(oid) &&
1558 oid->oid[4] == 2 /* digestAlgorithm */;
1562 int x509_sha1_oid(struct asn1_oid *oid)
1564 return oid->len == 6 &&
1565 oid->oid[0] == 1 /* iso */ &&
1566 oid->oid[1] == 3 /* identified-organization */ &&
1567 oid->oid[2] == 14 /* oiw */ &&
1568 oid->oid[3] == 3 /* secsig */ &&
1569 oid->oid[4] == 2 /* algorithms */ &&
1570 oid->oid[5] == 26 /* id-sha1 */;
1574 static int x509_sha2_oid(struct asn1_oid *oid)
1576 return oid->len == 9 &&
1577 oid->oid[0] == 2 /* joint-iso-itu-t */ &&
1578 oid->oid[1] == 16 /* country */ &&
1579 oid->oid[2] == 840 /* us */ &&
1580 oid->oid[3] == 1 /* organization */ &&
1581 oid->oid[4] == 101 /* gov */ &&
1582 oid->oid[5] == 3 /* csor */ &&
1583 oid->oid[6] == 4 /* nistAlgorithm */ &&
1584 oid->oid[7] == 2 /* hashAlgs */;
1588 int x509_sha256_oid(struct asn1_oid *oid)
1590 return x509_sha2_oid(oid) &&
1591 oid->oid[8] == 1 /* sha256 */;
1595 int x509_sha384_oid(struct asn1_oid *oid)
1597 return x509_sha2_oid(oid) &&
1598 oid->oid[8] == 2 /* sha384 */;
1602 int x509_sha512_oid(struct asn1_oid *oid)
1604 return x509_sha2_oid(oid) &&
1605 oid->oid[8] == 3 /* sha512 */;
1742 struct asn1_oid oid;
1748 if (!x509_pkcs_oid(&signature->oid) ||
1749 signature->oid.len != 7 ||
1750 signature->oid.oid[5] != 1 /* pkcs-1 */) {
1825 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1831 if (x509_sha1_oid(&oid)) {
1832 if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
1836 signature->oid.oid[6]);
1843 if (x509_sha256_oid(&oid)) {
1844 if (signature->oid.oid[6] !=
1849 signature->oid.oid[6]);
1856 if (x509_sha384_oid(&oid)) {
1857 if (signature->oid.oid[6] != 12 /* sha384WithRSAEncryption */) {
1861 signature->oid.oid[6]);
1868 if (x509_sha512_oid(&oid)) {
1869 if (signature->oid.oid[6] != 13 /* sha512WithRSAEncryption */) {
1873 signature->oid.oid[6]);
1880 if (!x509_digest_oid(&oid)) {
1885 switch (oid.oid[5]) {
1887 if (signature->oid.oid[6] != 4 /* md5WithRSAEncryption */) {
1891 signature->oid.oid[6]);
1900 "(%lu)", oid.oid[5]);
1922 switch (signature->oid.oid[6]) {
1956 "algorithm (%lu)", signature->oid.oid[6]);