Bug #52804 [NEW]: ssh2_auth_pubkey_file() requires both public and private keys
| From: | ron at roncemer dot com | Date: | Thu, 09 Sep 2010 17:21:25 +0000 |
| Subject: | Bug #52804 [NEW]: ssh2_auth_pubkey_file() requires both public and private keys | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-154216@lists.php.net to get a copy of this message | ||
From:
Operating system: Linux
PHP version: 5.3.3
Package: *General Issues
Bug Type: Bug
Bug description:ssh2_auth_pubkey_file() requires both public and private keys
Description:
------------
Every other ssh client I've ever dealt with, only requires the private key
to
authenticate to a remote server with ssh2.
Have a look at the ganymed Java SSH2 library, class name
ch.ethz.ssh2.Connection, function signature "boolean
authenticateWithPublicKey(java.lang.String user, java.io.File pemFile,
java.lang.String password)". All that is needed is the private-key pem
file in
order to authenticate. I've been using this library for years in Java, and
it
works great.
What is the reason for requiring both the public and private keys for
authenticating, when in reality only the private key is required? The
public
key should be easily extracted from private key, and should be handled
silently
by PHP.
Also, have a look at function signature "boolean
authenticateWithPublicKey(java.lang.String user, char[] pemPrivateKey,
java.lang.String password)". This provides a way to pass in the private
key as
an array of char. In PHP, this would be really useful. You could store
your
private keys in a secured database and use it for all kinds of server
authentication. The absence of this functionality in PHP actually presents
a
security risk, because to get it to work, you'd actually have to write your
private key to a temp file, then delete the temp file when done. Not as
secure
as reading it from a string which came from a secure database.
--
Edit bug report at http://bugs.php.net/bug.php?id=52804&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52804&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52804&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52804&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52804&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52804&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52804&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52804&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52804&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52804&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52804&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52804&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52804&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52804&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52804&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52804&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52804&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52804&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52804&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52804&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52804&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52804&r=mysqlcfg