• eroman@chromium.org's avatar
    [webcrypto] JWK: Reject keys with non-minimal bigintegers. · 31130d6c
    eroman@chromium.org authored
    RSA properties such as n, e, d, p, q, dp, dq, qi are big integers encoded as base64 url-safe, big-endian octet strings.
    
     * Reject big integers that contain leading zeros, since by the JWA rules they must be minimal.
     * Reject big integers that are the empty octet string (since 0 is the minimal representation of the big-endian number 0, not empty string).
    
    This also changes the exception message and type when one of the optional parameters p, q, dp, dq, qi are missing. Before it would give an OperationError, because NSS was unable to infer the missing parameters. Now it gives a DataError explaining that the parameter is required.
    
    BUG=374927,383998
    
    Review URL: https://codereview.chromium.org/416993009
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285798 0039d316-1c4b-4281-b951-d872f2087c98
    31130d6c
jwk.cc 29 KB