New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866604 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 27 days ago
Closed: Aug 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Extension Packager yields empty string as error message when given a traditionally formatted RSA key.

Project Member Reported by waff...@chromium.org, Jul 23

Issue description

To repro:

1 • Download the attached ZIP and unpack it into ~/tmp
2 • `openssl genrsa 4096 > out.pem`
3 • Navigate to chrome://extensions, enable developer mode, click Pack Extension.
4 • Select the unpacked extension dir from 1• (~/tmp) and out.pem from 2•, then pack the extension.

Expected: Packer gives error message amounting to "You must provide a PKCS#8-format PEM-encoded RSA key."
Actual: Packer gives "" as an error message.

This seems to be because we return directly here without setting the error message:
https://cs.chromium.org/chromium/src/extensions/browser/extension_creator.cc?gsn=ReadInputKey&l=138


For the record, the key above can be converted to the proper format with
openssl pkcs8 -topk8 -inform PEM -outform PEM -in out.pem -out pkcs8.pem -nocrypt
 
(Here's the zip I meant to attach in #1, though any valid unpacked extension will work.)
privacy_badger-chrome.zip
862 KB Download
Owner: lima...@gmail.com
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2b8127724ece48b13dc71c8f842bfa5376e8d001

commit 2b8127724ece48b13dc71c8f842bfa5376e8d001
Author: Sungguk Lim <limasdf@gmail.com>
Date: Tue Aug 28 05:35:11 2018

ExtensionCreator returns proper error message if a pem is not pkcs8 format

Extension creator which is in chrome://extensions allows only valid
pkcs8 format private key. This CL makes the extension creator return
proper error message if a private key is not pkcs8 format.

Bug:  866604 
Change-Id: I4579257f738995f87689c3aea98f6d07c4665f67
Reviewed-on: https://chromium-review.googlesource.com/1186283
Commit-Queue: Sungguk Lim <limasdf@gmail.com>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586592}
[modify] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/browser/BUILD.gn
[modify] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/browser/extension_creator.cc
[modify] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/browser/extension_creator.h
[add] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/browser/extension_creator_unittest.cc
[modify] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/strings/extensions_strings.grd
[add] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/test/data/extension_creator/not_pkcs.pem
[add] https://crrev.com/2b8127724ece48b13dc71c8f842bfa5376e8d001/extensions/test/data/extension_creator/pkcs8.pem

Status: Fixed (was: Started)
Thanks for taking this on!

Sign in to add a comment