boringssl/crypto/err
David Benjamin 68772b31b0 Implement new SPKI parsers.
Many consumers need SPKI support (X.509, TLS, QUIC, WebCrypto), each
with different ways to set signature parameters. SPKIs themselves can
get complex with id-RSASSA-PSS keys which come with various constraints
in the key parameters. This suggests we want a common in-library
representation of an SPKI.

This adds two new functions EVP_parse_public_key and
EVP_marshal_public_key which converts EVP_PKEY to and from SPKI and
implements X509_PUBKEY functions with them. EVP_PKEY seems to have been
intended to be able to express the supported SPKI types with
full-fidelity, so these APIs will continue this.

This means future support for id-RSASSA-PSS would *not* repurpose
EVP_PKEY_RSA. I'm worried about code assuming EVP_PKEY_RSA implies
acting on the RSA* is legal. Instead, it'd add an EVP_PKEY_RSA_PSS and
the data pointer would be some (exposed, so the caller may still check
key size, etc.) RSA_PSS_KEY struct. Internally, the EVP_PKEY_CTX
implementation would enforce the key constraints. If RSA_PSS_KEY would
later need its own API, that code would move there, but that seems
unlikely.

Ideally we'd have a 1:1 correspondence with key OID, although we may
have to fudge things if mistakes happen in standardization. (Whether or
not X.509 reuses id-ecPublicKey for Ed25519, we'll give it a separate
EVP_PKEY type.)

DSA parsing hooks are still implemented, missing parameters and all for
now. This isn't any worse than before.

Decoupling from the giant crypto/obj OID table will be a later task.

BUG=522228

Change-Id: I0e3964edf20cb795a18b0991d17e5ca8bce3e28c
Reviewed-on: https://boringssl-review.googlesource.com/6861
Reviewed-by: Adam Langley <agl@google.com>
2016-02-17 16:28:07 +00:00
..
asn1.errordata Remove ASN1_R_MALLOC_FAILURE. 2015-12-22 00:12:24 +00:00
bio.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
bn.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
cipher.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
CMakeLists.txt Add a run_tests target to run all tests. 2015-10-26 20:33:44 +00:00
conf.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
dh.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
digest.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
dsa.errordata Reimplement DSA parsing logic with crypto/asn1. 2016-02-17 00:26:01 +00:00
ec.errordata Rewrite ECPrivateKey serialization. 2016-02-16 23:51:09 +00:00
ecdh.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
ecdsa.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
engine.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
err_data_generate.go ERR_LIB_USER should be the last error. 2015-07-16 02:03:03 +00:00
err_test.cc Don't bother sampling __func__. 2015-11-03 22:50:59 +00:00
err.c Don't bother sampling __func__. 2015-11-03 22:50:59 +00:00
evp.errordata Implement new SPKI parsers. 2016-02-17 16:28:07 +00:00
hkdf.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
obj.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
pem.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
pkcs8.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
rsa.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
ssl.errordata Reset ssl error codes. 2015-12-16 18:38:20 +00:00
x509.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00
x509v3.errordata Get rid of err function codes. 2015-07-16 02:02:08 +00:00