-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support key
command
#5
Comments
Thank you very much for the great ideas. I added the pubkey command in the new release. |
Thank you for introducing I did a quick check on my extension (still not migrated to MV3, but in CRX3 format when obtained from webstore), confronting results with handy Chrome extension source viewer, openssl, and webstore. go-crx3 doesn't seem to provide proper results. go-crx3
Extension page > Chrome extension source viewer > View source > Dev Console:
openssl
Chrome Web Store > Developer Dashboard > Extension > Build > Package > View public keyShort analysisI noticed that output coming from go-crx3 is longer, so I did another quick check, by decoding base64 public keys, showing their info, and calculating extension ID from them.
I haven't analyzed your code, but above results at least show that go-crx3 assumes somewhere RSA >= 2K, which can not always be true for extensions added to webstore long time ago (e.g. my extension was created ~15y ago IIRC), i.e. before longer keys were strictly recommended / enforced. CRX Viewer also uses RSA 1K, so you can test on it too if you want. But it looks it's not only matter of key size. EDIT: You can look at ASN.1 dumps (e.g. using ASN.1 JavaScript decoder as
|
Thank you for the detailed feedback! I will take it into account. I admit I skimmed through the specification and apparently misunderstood the task. |
* fix(pubkey, id): fix generate pubkey and extension id, #5 * chore(commands): some improvements
@przemoc If possible, please check the latest release v1.5.1, where I fixed the retrieval of the ID from the public key and corrected the pubkey command. I compared (tested) the public keys and ID generation with Chrome tools and OpenSSL. Once again, thank you for the detailed description of the problem. If the issue is not resolved, please let me know. |
@mmadfox Thanks for working on this. I cannot afford right now to do a more thorough check, but I just did two quick checks, firstly on my extension, secondly on another extension. We're not there yet. :)
So it looks like it follows SubjectPublicKeyInfo format, but subjectPublicKey is still somehow becoming 2K.
Which means that the first problem I brought up in my previous comment remains true:
It seems there is yet another issue. Pubkey seemingly returns same (garbage?) stuff now.
|
Thank you for the detailed report on the issue. I will fix the error soon. Yes, I missed something in the implementation… |
id
command is already supported, but another useful one would bekey
.key
should be equivalent of what following command does on private key:openssl rsa -in key.pem -pubout -outform DER | openssl base64 -A
If CRX/ZIP's manifest.json has a key field, then
key
command could be made to work also on such CRX/ZIP files and display their key then.This key value is useful for developers to keep consistent ID:
https://developer.chrome.com/docs/extensions/reference/manifest/key
BTW thank you for creating the tool! This year I have to update my web browser extension, NavigUp, and migrate to Manifest V3 (known issues, checklist) to ensure its users won't be impacted by Manifest V2 support timeline, specifically:
At some point Chrome deprecated CRX2 format and introduced CRX3 - CRX₃ Design Doc. Beside relying on Chrome Web Store, I always self-hosted my extension too, so being able to create CRX3 easily will be super handy.
In the distant past I used
crxmake
, possibly https://github.com/Constellation/crxmake, but I have no notes to tell for sure. I refuse to accept need to use hundred megabyte browser binary to createcrx
file. If not for your tool, i.e.crx3
, I would possibly had to write one for myself (most likely in C/C++). There are some JavaScript based solutions, but I'm not fan of JavaScript runtime environments like Node.js, and prefer more standalone solutions.The text was updated successfully, but these errors were encountered: