if (sinfo->unsupported_crypto) {
kleave(" = -ENOPKG [cached]"); return -ENOPKG;
}
for (x509 = sinfo->signer; x509; x509 = x509->signer) { if (x509->seen) { if (x509->verified) goto verified;
kleave(" = -ENOKEY [cached]"); return -ENOKEY;
}
x509->seen = true;
/* Look to see if this certificate is present in the trusted *keys.
*/
key = find_asymmetric_key(trust_keyring,
x509->id, x509->skid, NULL, false); if (!IS_ERR(key)) { /* One of the X.509 certificates in the PKCS#7 message *isapparentlythesameasonewealreadytrust. *Verifythatthetrustedvariantcanalsovalidate *thesignatureonthedescendant.
*/
pr_devel("sinfo %u: Cert %u as key %x\n",
sinfo->index, x509->index, key_serial(key)); goto matched;
} if (key == ERR_PTR(-ENOMEM)) return -ENOMEM;
/* Self-signed certificates form roots of their own, and if we *don'tknowthem,thenwecan'tacceptthem.
*/ if (x509->signer == x509) {
kleave(" = -ENOKEY [unknown self-signed]"); return -ENOKEY;
}
might_sleep();
last = x509;
sig = last->sig;
}
/* No match - see if the root certificate has a signer amongst the *trustedkeys.
*/ if (last && (last->sig->auth_ids[0] || last->sig->auth_ids[1])) {
key = find_asymmetric_key(trust_keyring,
last->sig->auth_ids[0],
last->sig->auth_ids[1],
NULL, false); if (!IS_ERR(key)) {
x509 = last;
pr_devel("sinfo %u: Root cert %u signer is key %x\n",
sinfo->index, x509->index, key_serial(key)); goto matched;
} if (PTR_ERR(key) != -ENOKEY) return PTR_ERR(key);
}
/* As a last resort, see if we have a trusted public key that matches *thesignedinfodirectly.
*/
key = find_asymmetric_key(trust_keyring,
sinfo->sig->auth_ids[0], NULL, NULL, false); if (!IS_ERR(key)) {
pr_devel("sinfo %u: Direct signer is key %x\n",
sinfo->index, key_serial(key));
x509 = NULL;
sig = sinfo->sig; goto matched;
} if (PTR_ERR(key) != -ENOKEY) return PTR_ERR(key);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.