note 113839 added to function.ssh2-fingerprint
| From: | LyleMantooth | Date: | Sat, 07 Dec 2013 15:42:36 +0000 |
| Subject: | note 113839 added to function.ssh2-fingerprint | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197829@lists.php.net to get a copy of this message | ||
If you're going to compare the fingerprint to a user-submitted form field, it's probably a
good idea to do case-insensitive comparison:
<?php
if ($conn = ssh2_connect($user, $password)) {
$fingerprint = ssh2_fingerprint($conn);
if (strcasecmp($fingerprint, $known_value) === 0) {
// Do your thing.
}
}
?>
Of course, this is only necessary when you use the SSH2_FINGERPRINT_HEX option, not
SSH2_FINGERPRINT_RAW.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.ssh2-fingerprint.php
Edit -- https://master.php.net/note/edit/113839
Del: integrated -- https://master.php.net/note/delete/113839/integrated
Del: useless -- https://master.php.net/note/delete/113839/useless
Del: bad code -- https://master.php.net/note/delete/113839/bad+code
Del: spam -- https://master.php.net/note/delete/113839/spam
Del: non-english -- https://master.php.net/note/delete/113839/non-english
Del: in docs -- https://master.php.net/note/delete/113839/in+docs
Del: other reasons-- https://master.php.net/note/delete/113839
Reject -- https://master.php.net/note/reject/113839
Search -- https://master.php.net/manage/user-notes.php