Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rrdtool-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@ function rrdp_cmd__set_rsa($socket, $args) {
file_put_contents('./include/public.key', $rrdp_config['encryption']['public_key']);
file_put_contents('./include/private.key', $rrdp_config['encryption']['private_key']);

$rsa->loadPulicKey($rrdp_config['encryption']['public_key']);
$rsa->loadPublicKey($rrdp_config['encryption']['public_key']);
$rrdp_config['encryption']['public_key_fingerprint'] = $rsa->getFingerprint();
Comment on lines +2005 to 2006
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSA::loadPublicKey() in phpseclib returns a key object; calling it as $rsa->loadPublicKey(...) and then ignoring the return value means $rsa->getFingerprint() is likely operating on the wrong object (and may not exist), so the fingerprint calculation can still fail. Align this with rrdp_system__encryption_init() by assigning the return value of RSA::loadPublicKey(...) (or using the $public key object directly) and calling getFingerprint() on that key object.

Suggested change
$rsa->loadPublicKey($rrdp_config['encryption']['public_key']);
$rrdp_config['encryption']['public_key_fingerprint'] = $rsa->getFingerprint();
$public_key = $rsa->loadPublicKey($rrdp_config['encryption']['public_key']);
$rrdp_config['encryption']['public_key_fingerprint'] = $public_key->getFingerprint();

Copilot uses AI. Check for mistakes.

rrdp_cmd__show($socket, [ 0=>'rsa', 1=>'publickey']);
Expand Down