Index: content/child/webcrypto/jwk.cc |
diff --git a/content/child/webcrypto/jwk.cc b/content/child/webcrypto/jwk.cc |
index 53dd787d7a36cc5ebe15fc9aedc7370a1d10aff4..e2a255a43c476e6b4ab5197332e5a890ef5f518f 100644 |
--- a/content/child/webcrypto/jwk.cc |
+++ b/content/child/webcrypto/jwk.cc |
@@ -284,6 +284,15 @@ class JwkAlgorithmRegistry { |
alg_to_info_["RSA-OAEP"] = |
JwkAlgorithmInfo(&BindAlgorithmId<CreateRsaOaepImportAlgorithm, |
blink::WebCryptoAlgorithmIdSha1>); |
+ alg_to_info_["RSA-OAEP-256"] = |
+ JwkAlgorithmInfo(&BindAlgorithmId<CreateRsaOaepImportAlgorithm, |
+ blink::WebCryptoAlgorithmIdSha256>); |
+ alg_to_info_["RSA-OAEP-384"] = |
+ JwkAlgorithmInfo(&BindAlgorithmId<CreateRsaOaepImportAlgorithm, |
+ blink::WebCryptoAlgorithmIdSha384>); |
+ alg_to_info_["RSA-OAEP-512"] = |
+ JwkAlgorithmInfo(&BindAlgorithmId<CreateRsaOaepImportAlgorithm, |
+ blink::WebCryptoAlgorithmIdSha512>); |
alg_to_info_["A128KW"] = JwkAlgorithmInfo( |
&BindAlgorithmId<CreateAlgorithm, blink::WebCryptoAlgorithmIdAesKw>, |
128); |
@@ -565,22 +574,47 @@ Status WriteAlg(const blink::WebCryptoKeyAlgorithm& algorithm, |
} |
break; |
case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: |
- switch (algorithm.rsaHashedParams()->hash().id()) { |
- case blink::WebCryptoAlgorithmIdRsaOaep: |
- jwk_dict->SetString("alg", "RSA-OAEP"); |
Ryan Sleevi
2014/05/16 05:17:22
LULWUT
|
- break; |
- case blink::WebCryptoAlgorithmIdSha1: |
- jwk_dict->SetString("alg", "RS1"); |
- break; |
- case blink::WebCryptoAlgorithmIdSha256: |
- jwk_dict->SetString("alg", "RS256"); |
- break; |
- case blink::WebCryptoAlgorithmIdSha384: |
- jwk_dict->SetString("alg", "RS384"); |
+ switch (algorithm.id()) { |
+ case blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: { |
+ switch (algorithm.rsaHashedParams()->hash().id()) { |
+ case blink::WebCryptoAlgorithmIdSha1: |
+ jwk_dict->SetString("alg", "RS1"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha256: |
+ jwk_dict->SetString("alg", "RS256"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha384: |
+ jwk_dict->SetString("alg", "RS384"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha512: |
+ jwk_dict->SetString("alg", "RS512"); |
+ break; |
+ default: |
+ NOTREACHED(); |
+ return Status::ErrorUnexpected(); |
+ } |
break; |
- case blink::WebCryptoAlgorithmIdSha512: |
- jwk_dict->SetString("alg", "RS512"); |
+ } |
+ case blink::WebCryptoAlgorithmIdRsaOaep: { |
+ switch (algorithm.rsaHashedParams()->hash().id()) { |
+ case blink::WebCryptoAlgorithmIdSha1: |
+ jwk_dict->SetString("alg", "RSA-OAEP"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha256: |
+ jwk_dict->SetString("alg", "RSA-OAEP-256"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha384: |
+ jwk_dict->SetString("alg", "RSA-OAEP-384"); |
+ break; |
+ case blink::WebCryptoAlgorithmIdSha512: |
+ jwk_dict->SetString("alg", "RSA-OAEP-512"); |
+ break; |
+ default: |
+ NOTREACHED(); |
+ return Status::ErrorUnexpected(); |
+ } |
break; |
+ } |
default: |
NOTREACHED(); |
return Status::ErrorUnexpected(); |