Last modified: 2014-03-06 08:47:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T62130, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60130 - OAuth consumer registration doesn't accept OpenSSH v2 public key
OAuth consumer registration doesn't accept OpenSSH v2 public key
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
OAuth (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-16 13:46 UTC by metatron
Modified: 2014-03-06 08:47 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description metatron 2014-01-16 13:46:09 UTC
On OAuth consumer registration page public keys generated with OpenSSH are not accepted.

Details:

1. key generated with  ~$ ssh-keygen -t rsa   (2048 bit, RSA v2)
2. converted public key to PEM  ~$ ssh-keygen -f .ssh/id_rsa.pub -e -m PEM
3. resulting key is not accepted

-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEA0eAtAFJUMxcJHmzJc2piWfFP2teIu99yqM0zZNl60H65M+bQ7ZnF
p2AqIFlmPTKUQYYq22YzEkTEL37WC3L6ISUfkJ5iFOD7tkCtjX2cUiIKTY2VnJry
9JX7IcxfM/CcOB4xdSwzhsi82ERlQSd8B1RreSbRHuCn6Y6gXkO5kYfx3CoX8PRx
h4vj7uDHBLnsPDhYmhWZvxhZNBJwCieFnOwpVcAH+lSZq+LWeb0gcOjZnmbCZCm3
RyMVLSob6DjFdPuVzSEyeyZL57NjyxcCDcpFU2dSLAUxw87x3Jid7rxbmUqC2OK9
YAoN37ZvoDC3/S5ixkdqGsUJpUh4oQYpNwIDAQAB
-----END RSA PUBLIC KEY-----

Regards
Hedonil
Comment 1 Chris Steipp 2014-01-16 14:59:50 UTC
The key is used by the openssl_get_publickey function. I'll see if I can find a way to turn an ssh key into one that openssl accepts.

In the meantime, you can generate a key with:

$ openssl genrsa -out appkey.pem 4096
$ openssl rsa -in appkey.pem -pubout > appkey.pub
Comment 2 Brad Jorsch 2014-01-16 15:58:30 UTC
I just had a look at this, and apparently what ssh-keygen calls "pem" is not what openssl thinks of as pem. If you use "ssh-keygen -f .ssh/id_rsa.pub -e -m pkcs8" instead, that seems to work when I try it locally.

Still, why not just use openssl genrsa to generate the key?
Comment 3 metatron 2014-01-16 16:54:51 UTC
Working with plain openssl does the trick, as suggested here and earlier in IRC. I just mentioned it because there was no clear hint in the submission form what was wrong with my SSL v2 key and we've experienced multiple incompatibilities with rsa keys before

Just to mention:

- Many windows users use PuTTYGen rsa keys, but they are not compatible with some applications like MySQL Workbench

- recommended way to create new keys for tool labs is OpenSSL ssh-keygen

- now we have OAuth with OpenSSH

It would just be more convenient (at least for me) if there would be less keys to manage ;)

Thx for the suggestions. I will try the -m pkcs8, too.

Hedonil
Comment 4 metatron 2014-01-16 16:56:00 UTC
(In reply to comment #3)
> Working with plain openssl does the trick, as suggested here and earlier in
> IRC. I just mentioned it because there was no clear hint in the submission
> form
> what was wrong with my SSL v2 key and we've experienced multiple
> incompatibilities with rsa keys before
> 
> Just to mention:
> 
> - Many windows users use PuTTYGen rsa keys, but they are not compatible with
> some applications like MySQL Workbench
> 
> - recommended way to create new keys for tool labs is OpenSSL ssh-keygen
> 
> - now we have OAuth with OpenSSH
> 
> It would just be more convenient (at least for me) if there would be less
> keys
> to manage ;)
> 
> Thx for the suggestions. I will try the -m pkcs8, too.
> 
> Hedonil

typo OpenSSH <-> OpenSSL ; but you know what is meant.
Comment 5 James Alexander 2014-01-23 03:45:07 UTC
yeah, this caused enormous headache for me when I was registering because I couldn't for the life of me figure out what format it wanted (especially with the errors that kept coming). In the end Chris pointed me to his developer tutorial on  https://www.mediawiki.org/wiki/OAuth/For_Developers which has an example using openssh which, while easy, is not what I think most people would gravitate too given they keys we use elsewhere. 

On a mostly unrelated note we should probably find a good place to link to https://www.mediawiki.org/wiki/OAuth/For_Developers ... right now the only thing that does is some training notes in Chris' userspace...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links