James Morris wrote: > I'd like to see some serious effort at code review and testing before this > code is merged. With regard to testing, I've run multiple simultaneous instances of a number of test scripts against it continuously for the best part of a day: (1) A script to generate completely random data and attempt to stuff that into a key. The completely random data blob is fed wholly and then partially in decreasing amounts to keyctl padd. Then the script loops and starts again. ./fuzz-x509.sh /tmp/data1 (2) A script to generate random valid ASN.1: while :; do ./asn1random.pl | keyctl padd asymmetric vlad @s; done (3) A script to generate correctly formatted X.509 certificates filled with random data, including for the RSA key and signature fields. while :; do ./x509random.pl | keyctl padd asymmetric vlad @s; done (4) A variant of (3) that injects random bytes into the structure, whilst correctly maintaining the length counts outside of those. while :; do ./x509random.pl -i | keyctl padd asymmetric vlad @s; done (5) A script to repeatedly generate valid X.509 certificates and stuff those in, and then generate valid PKCS#7 signatures over random data and try to stuff those in too (which should fail). ./x509-stuffer.sh David