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) {
432 (u8 *) oid.oid,
433 oid.len * sizeof(oid.oid[0]));
756 static int x509_id_ce_oid(struct asn1_oid *oid)
759 return oid->len >= 4 &&
760 oid->oid[0] == 2 /* joint-iso-ccitt */ &&
761 oid->oid[1] == 5 /* ds */ &&
762 oid->oid[2] == 29 /* id-ce */;
766 static int x509_any_ext_key_usage_oid(struct asn1_oid *oid)
768 return oid->len == 6 &&
769 x509_id_ce_oid(oid) &&
770 oid->oid[3] == 37 /* extKeyUsage */ &&
771 oid->oid[4] == 0 /* anyExtendedKeyUsage */;
1123 static int x509_id_pkix_oid(struct asn1_oid *oid)
1125 return oid->len >= 7 &&
1126 oid->oid[0] == 1 /* iso */ &&
1127 oid->oid[1] == 3 /* identified-organization */ &&
1128 oid->oid[2] == 6 /* dod */ &&
1129 oid->oid[3] == 1 /* internet */ &&
1130 oid->oid[4] == 5 /* security */ &&
1131 oid->oid[5] == 5 /* mechanisms */ &&
1132 oid->oid[6] == 7 /* id-pkix */;
1136 static int x509_id_kp_oid(struct asn1_oid *oid)
1139 return oid->len >= 8 &&
1140 x509_id_pkix_oid(oid) &&
1141 oid->oid[7] == 3 /* id-kp */;
1145 static int x509_id_kp_server_auth_oid(struct asn1_oid *oid)
1148 return oid->len == 9 &&
1149 x509_id_kp_oid(oid) &&
1150 oid->oid[8] == 1 /* id-kp-serverAuth */;
1154 static int x509_id_kp_client_auth_oid(struct asn1_oid *oid)
1157 return oid->len == 9 &&
1158 x509_id_kp_oid(oid) &&
1159 oid->oid[8] == 2 /* id-kp-clientAuth */;
1163 static int x509_id_kp_ocsp_oid(struct asn1_oid *oid)
1166 return oid->len == 9 &&
1167 x509_id_kp_oid(oid) &&
1168 oid->oid[8] == 9 /* id-kp-OCSPSigning */;
1177 struct asn1_oid oid;
1203 if (asn1_get_oid(pos, end - pos, &oid, &pos))
1205 if (x509_any_ext_key_usage_oid(&oid)) {
1208 } else if (x509_id_kp_server_auth_oid(&oid)) {
1211 } else if (x509_id_kp_client_auth_oid(&oid)) {
1214 } else if (x509_id_kp_ocsp_oid(&oid)) {
1218 asn1_oid_to_str(&oid, buf, sizeof(buf));
1230 struct asn1_oid *oid,
1233 if (!x509_id_ce_oid(oid))
1242 switch (oid->oid[3]) {
1264 struct asn1_oid oid;
1287 if (asn1_get_oid(pos, end - pos, &oid, &pos) < 0) {
1318 asn1_oid_to_str(&oid, buf, sizeof(buf));
1323 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1571 static int x509_rsadsi_oid(struct asn1_oid *oid)
1573 return oid->len >= 4 &&
1574 oid->oid[0] == 1 /* iso */ &&
1575 oid->oid[1] == 2 /* member-body */ &&
1576 oid->oid[2] == 840 /* us */ &&
1577 oid->oid[3] == 113549 /* rsadsi */;
1581 static int x509_pkcs_oid(struct asn1_oid *oid)
1583 return oid->len >= 5 &&
1584 x509_rsadsi_oid(oid) &&
1585 oid->oid[4] == 1 /* pkcs */;
1589 static int x509_digest_oid(struct asn1_oid *oid)
1591 return oid->len >= 5 &&
1592 x509_rsadsi_oid(oid) &&
1593 oid->oid[4] == 2 /* digestAlgorithm */;
1597 int x509_sha1_oid(struct asn1_oid *oid)
1599 return oid->len == 6 &&
1600 oid->oid[0] == 1 /* iso */ &&
1601 oid->oid[1] == 3 /* identified-organization */ &&
1602 oid->oid[2] == 14 /* oiw */ &&
1603 oid->oid[3] == 3 /* secsig */ &&
1604 oid->oid[4] == 2 /* algorithms */ &&
1605 oid->oid[5] == 26 /* id-sha1 */;
1609 static int x509_sha2_oid(struct asn1_oid *oid)
1611 return oid->len == 9 &&
1612 oid->oid[0] == 2 /* joint-iso-itu-t */ &&
1613 oid->oid[1] == 16 /* country */ &&
1614 oid->oid[2] == 840 /* us */ &&
1615 oid->oid[3] == 1 /* organization */ &&
1616 oid->oid[4] == 101 /* gov */ &&
1617 oid->oid[5] == 3 /* csor */ &&
1618 oid->oid[6] == 4 /* nistAlgorithm */ &&
1619 oid->oid[7] == 2 /* hashAlgs */;
1623 int x509_sha256_oid(struct asn1_oid *oid)
1625 return x509_sha2_oid(oid) &&
1626 oid->oid[8] == 1 /* sha256 */;
1630 int x509_sha384_oid(struct asn1_oid *oid)
1632 return x509_sha2_oid(oid) &&
1633 oid->oid[8] == 2 /* sha384 */;
1637 int x509_sha512_oid(struct asn1_oid *oid)
1639 return x509_sha2_oid(oid) &&
1640 oid->oid[8] == 3 /* sha512 */;
1777 struct asn1_oid oid;
1783 if (!x509_pkcs_oid(&signature->oid) ||
1784 signature->oid.len != 7 ||
1785 signature->oid.oid[5] != 1 /* pkcs-1 */) {
1864 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1887 if (x509_sha1_oid(&oid)) {
1888 if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
1892 signature->oid.oid[6]);
1899 if (x509_sha256_oid(&oid)) {
1900 if (signature->oid.oid[6] !=
1905 signature->oid.oid[6]);
1912 if (x509_sha384_oid(&oid)) {
1913 if (signature->oid.oid[6] != 12 /* sha384WithRSAEncryption */) {
1917 signature->oid.oid[6]);
1924 if (x509_sha512_oid(&oid)) {
1925 if (signature->oid.oid[6] != 13 /* sha512WithRSAEncryption */) {
1929 signature->oid.oid[6]);
1936 if (!x509_digest_oid(&oid)) {
1941 switch (oid.oid[5]) {
1943 if (signature->oid.oid[6] != 4 /* md5WithRSAEncryption */) {
1947 signature->oid.oid[6]);
1956 "(%lu)", oid.oid[5]);
1978 switch (signature->oid.oid[6]) {
2012 "algorithm (%lu)", signature->oid.oid[6]);