Changeset View
Changeset View
Standalone View
Standalone View
scripts/ssh/ssh-auth.php
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// If we've received an "--sshd-key" argument and it matches some known key, | // If we've received an "--sshd-key" argument and it matches some known key, | ||||
// only emit that key. (For now, if the key doesn't match, we'll fall back to | // only emit that key. (For now, if the key doesn't match, we'll fall back to | ||||
// emitting all keys.) | // emitting all keys.) | ||||
if ($sshd_key !== null) { | if ($sshd_key !== null) { | ||||
$matches = array(); | $matches = array(); | ||||
foreach ($authstruct['keys'] as $key => $key_struct) { | foreach ($authstruct['keys'] as $key => $key_struct) { | ||||
if (phutil_hashes_are_identical($key_struct['key'], $sshd_key)) { | if ($key_struct['key'] === $sshd_key) { | ||||
$matches[$key] = $key_struct; | $matches[$key] = $key_struct; | ||||
} | } | ||||
} | } | ||||
if ($matches) { | if ($matches) { | ||||
$authstruct['keys'] = $matches; | $authstruct['keys'] = $matches; | ||||
} | } | ||||
} | } | ||||
Show All 36 Lines |