boringssl/crypto/rsa
David Benjamin f4ef9b517e otherPrimeInfos is not optional in version 1 RSAPrivateKeys.
Currently, we correctly refuse to parse version 0 multi-prime keys, but we
still parse version 1 two-prime keys. Both should be rejected.

I missed an additional clause in the spec originally. It seems otherPrimeInfos
is marked OPTIONAL not because it is actually optional, but because they wanted
the two RSAPrivateKey forms to share one definition. The prose rules following
the definition imply that otherPrimeInfos' presence is entirely determined by
the version:

    * version is the version number, for compatibility with future
      revisions of this document.  It shall be 0 for this version of the
      document, unless multi-prime is used, in which case it shall be 1.

            Version ::= INTEGER { two-prime(0), multi(1) }
               (CONSTRAINED BY
               {-- version must be multi if otherPrimeInfos present --})

and:

    * otherPrimeInfos contains the information for the additional primes
      r_3, ..., r_u, in order.  It shall be omitted if version is 0 and
      shall contain at least one instance of OtherPrimeInfo if version
      is 1.

Change-Id: I458232a2e20ed68fddcc39c4c45333f33441f70b
Reviewed-on: https://boringssl-review.googlesource.com/7143
Reviewed-by: Adam Langley <agl@google.com>
2016-02-17 18:28:05 +00:00
..
blinding.c Remove out-of-date and misleading comment in |bn_blinding_st|. 2016-02-11 22:01:14 +00:00
CMakeLists.txt Add a run_tests target to run all tests. 2015-10-26 20:33:44 +00:00
internal.h Remove unused bits of RSA blinding code. 2016-02-09 16:45:13 +00:00
padding.c Clarify some confusing casts involving |size_t|. 2016-02-12 15:37:15 +00:00
rsa_asn1.c otherPrimeInfos is not optional in version 1 RSAPrivateKeys. 2016-02-17 18:28:05 +00:00
rsa_impl.c Remove unused bits of RSA blinding code. 2016-02-09 16:45:13 +00:00
rsa_test.cc Refuse to parse RSA pubkeys with invalid exponents. 2015-12-21 23:49:02 +00:00
rsa.c Don't cast |OPENSSL_malloc|/|OPENSSL_realloc| result. 2016-02-11 22:07:56 +00:00