New issue
Advanced search Search tips

Issue 799410 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Task



Sign in to add a comment

platformKeys.getKeyPair should not return a private key if it is not accessible

Project Member Reported by pmarko@chromium.org, Jan 5 2018

Issue description

Current situation:
platformKeys.getKeyPair state that it may return null as privateKey if the private key is not accessible[1].
However, it currently always returns something as "privateKey" if the public key was parseable[2].
The existence/accessibility check for the private key is then done in the sign operation.

Planned change:
Perform an existence/accessibility check for the private key in "getKeyPair" and return null for privateKey if it does not exist or is not accessible from the profile/calling extension.

Also adapt tests, as they currently expect sign to always get a privateKey and then they expect sign to fail, see the TODO in [3] and the sign error evaluation in [4].

[1] https://cs.chromium.org/chromium/src/chrome/common/extensions/api/platform_keys.idl?rcl=ddf9d60c175d5f5ae12bb7ca962c843149ab4129&l=98
[2] https://cs.chromium.org/chromium/src/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js?rcl=ddf9d60c175d5f5ae12bb7ca962c843149ab4129&l=60
[3] https://cs.chromium.org/chromium/src/chrome/test/data/extensions/api_test/platform_keys/basic.js?rcl=ddf9d60c175d5f5ae12bb7ca962c843149ab4129&l=430
[4] https://cs.chromium.org/chromium/src/chrome/test/data/extensions/api_test/platform_keys/basic.js?rcl=ddf9d60c175d5f5ae12bb7ca962c843149ab4129&l=447
 
Labels: pmarko-backlog

Sign in to add a comment