summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
diff options
context:
space:
mode:
authorpneubeck <pneubeck@chromium.org>2015-03-25 05:02:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-25 12:03:13 +0000
commit80709e2614a1530449e0aacb67d85f5b6d8a5db5 (patch)
tree54ff6ef41432a744cd6e7302b121d39b38e68ffd /chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
parent3ca6f10de871334d2fe328a174cf296d1cf24ed2 (diff)
downloadchromium_src-80709e2614a1530449e0aacb67d85f5b6d8a5db5.zip
chromium_src-80709e2614a1530449e0aacb67d85f5b6d8a5db5.tar.gz
chromium_src-80709e2614a1530449e0aacb67d85f5b6d8a5db5.tar.bz2
chrome.platformKeys.getKeyPair: Check requested algorithm against certificate.
This adds a check that the requested algorithm is actually permitted by the certificate as defined in the algorithm field of the Subject Public Key Info. BUG=466584 Review URL: https://codereview.chromium.org/998293002 Cr-Commit-Position: refs/heads/master@{#322142}
Diffstat (limited to 'chrome/renderer/resources/extensions/platform_keys_custom_bindings.js')
-rw-r--r--chrome/renderer/resources/extensions/platform_keys_custom_bindings.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
index 9320e02..1f30c1f 100644
--- a/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
@@ -49,6 +49,10 @@ binding.registerCustomHook(function(api) {
apiFunctions.setHandleRequest(
'getKeyPair', function(cert, params, callback) {
getPublicKey(cert, params, function(publicKey, algorithm) {
+ if (chrome.runtime.lastError) {
+ callback();
+ return;
+ }
callback(createPublicKey(publicKey, algorithm),
createPrivateKey(publicKey, algorithm));
});