mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Flesh out ssh2_fingerprint() docs.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175730 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9066a2ede4
commit
637c733a67
1 changed files with 35 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.ssh2-fingerprint">
|
||||
<refnamediv>
|
||||
|
@ -12,14 +12,45 @@
|
|||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>ssh2_fingerprint</methodname>
|
||||
<methodparam choice="opt"><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a server hostkey hash from an active session
|
||||
Defaults to MD5 fingerprint encoded as ASCII hex values
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
<parameter>flags</parameter> may be either of
|
||||
<constant>SSH2_FINGERPRINT_MD5</constant> or
|
||||
<constant>SSH2_FINGERPRINT_SHA1</constant> logically ORed with
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant> or
|
||||
<constant>SSH2_FINGERPRINT_RAW</constant>.
|
||||
Defaults to <constant>SSH2_FINGERPRINT_MD5</constant> |
|
||||
<constant>SSH2_FINGERPRINT_HEX</constant>.
|
||||
</simpara>
|
||||
|
||||
<example>
|
||||
<title>Checking the fingerprint against a known value</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$known_host = '6F89C2F0A719B30CC38ABDF90755F2E4';
|
||||
|
||||
$connection = ssh2_connect('shell.example.com', 22);
|
||||
|
||||
$fingerprint = ssh2_fingerprint($connection,
|
||||
SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);
|
||||
|
||||
if ($fingerprint != $known_host) {
|
||||
die("HOSTKEY MISMATCH!\n" .
|
||||
"Possible Man-In-The-Middle Attack?");
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue