Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSHFP RR supports neither ECDSA algorithm nor SHA-256 fingerprint defined by RFC 6594. #39

Closed
bishopb opened this issue Dec 28, 2015 · 1 comment

Comments

@bishopb
Copy link
Contributor

bishopb commented Dec 28, 2015

The following code should work, but fails because kyhwana.org exposes both the ECDSA algorithm and SHA-256 fingerprint.

$google = new \Net_DNS2_Resolver(['nameservers' => ['8.8.8.8', '8.8.4.4']]);
$google->dnssec = true;
try {
    $result = $google->query('kyhwana.org', 'SSHFP');
} catch(\Net_DNS2_Exception $ex) {
    die($ex->getMessage());
}

foreach ($result->answer as $answer) {
    if ($answer instanceof \Net_DNS2_RR_SSHFP) {
        printf(
            '%s %d %s %s %d %d %s' . PHP_EOL,
            $answer->name,
            $answer->ttl,
            $answer->class,
            $answer->type,
            $answer->algorithm,
            $answer->fp_type,
            $answer->fingerprint
        );
    }
}

See also this post on SO, which led me to the problem in the first place.

@mikepultz
Copy link
Owner

Thanks for the patch- I've merged your changes in trunk,

Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants