Lines Matching refs:oid
38 static int oid_is_rsadsi(struct asn1_oid *oid) in oid_is_rsadsi() argument
40 return oid->len >= 4 && in oid_is_rsadsi()
41 oid->oid[0] == 1 /* iso */ && in oid_is_rsadsi()
42 oid->oid[1] == 2 /* member-body */ && in oid_is_rsadsi()
43 oid->oid[2] == 840 /* us */ && in oid_is_rsadsi()
44 oid->oid[3] == 113549 /* rsadsi */; in oid_is_rsadsi()
48 static int pkcs5_is_oid(struct asn1_oid *oid, unsigned long alg) in pkcs5_is_oid() argument
50 return oid->len == 7 && in pkcs5_is_oid()
51 oid_is_rsadsi(oid) && in pkcs5_is_oid()
52 oid->oid[4] == 1 /* pkcs */ && in pkcs5_is_oid()
53 oid->oid[5] == 5 /* pkcs-5 */ && in pkcs5_is_oid()
54 oid->oid[6] == alg; in pkcs5_is_oid()
58 static int enc_alg_is_oid(struct asn1_oid *oid, unsigned long alg) in enc_alg_is_oid() argument
60 return oid->len == 6 && in enc_alg_is_oid()
61 oid_is_rsadsi(oid) && in enc_alg_is_oid()
62 oid->oid[4] == 3 /* encryptionAlgorithm */ && in enc_alg_is_oid()
63 oid->oid[5] == alg; in enc_alg_is_oid()
67 static int pkcs12_is_pbe_oid(struct asn1_oid *oid, unsigned long alg) in pkcs12_is_pbe_oid() argument
69 return oid->len == 8 && in pkcs12_is_pbe_oid()
70 oid_is_rsadsi(oid) && in pkcs12_is_pbe_oid()
71 oid->oid[4] == 1 /* pkcs */ && in pkcs12_is_pbe_oid()
72 oid->oid[5] == 12 /* pkcs-12 */ && in pkcs12_is_pbe_oid()
73 oid->oid[6] == 1 /* pkcs-12PbeIds */ && in pkcs12_is_pbe_oid()
74 oid->oid[7] == alg; in pkcs12_is_pbe_oid()
78 static enum pkcs5_alg pkcs5_get_alg(struct asn1_oid *oid) in pkcs5_get_alg() argument
80 if (pkcs5_is_oid(oid, 3)) /* pbeWithMD5AndDES-CBC (PBES1) */ in pkcs5_get_alg()
82 if (pkcs12_is_pbe_oid(oid, 3)) /* pbeWithSHAAnd3-KeyTripleDES-CBC */ in pkcs5_get_alg()
84 if (pkcs5_is_oid(oid, 13)) /* id-PBES2 (PBES2) */ in pkcs5_get_alg()
95 struct asn1_oid oid; in pkcs5_get_params_pbes2() local
132 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs5_get_params_pbes2()
138 asn1_oid_to_str(&oid, obuf, sizeof(obuf)); in pkcs5_get_params_pbes2()
141 if (!pkcs5_is_oid(&oid, 12)) /* id-PBKDF2 */ { in pkcs5_get_params_pbes2()
236 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs5_get_params_pbes2()
242 asn1_oid_to_str(&oid, obuf, sizeof(obuf)); in pkcs5_get_params_pbes2()
245 if (enc_alg_is_oid(&oid, 7)) { in pkcs5_get_params_pbes2()
282 struct asn1_oid oid; in pkcs5_get_params() local
291 if (asn1_get_oid(enc_alg, enc_alg_end - enc_alg, &oid, &pos)) { in pkcs5_get_params()
297 asn1_oid_to_str(&oid, obuf, sizeof(obuf)); in pkcs5_get_params()
299 params->alg = pkcs5_get_alg(&oid); in pkcs5_get_params()