| OpenHAP::Test::Controller::SRP(3p) | Perl Library Manual | OpenHAP::Test::Controller::SRP(3p) |
NAME
OpenHAP::Test::Controller::SRP - SRP-6a client role for tests
SYNOPSIS
use OpenHAP::Test::Controller::SRP;
my $srp = OpenHAP::Test::Controller::SRP->new(
password => '031-45-154');
my $A = $srp->compute_public; # 384 bytes, send in M3
my $M1 = $srp->compute_proof($salt, $B); # from the server's M2
my $K = $srp->session_key; # 64 bytes shared key
$srp->verify_server_proof($M2) or die 'server proof invalid';
DESCRIPTION
The client (controller) role of the SRP-6a exchange served by OpenHAP::SRP: the same RFC 5054 3072-bit group, g = 5, SHA-512 hash, fixed username "Pair-Setup", and 384-byte padding rules (spec/HAP-Pairing.md section 2). The setup code is normalized like the server side (dashes and spaces stripped).
METHODS
new(%args)
"password" is the 8-digit setup code; "username" defaults to "Pair-Setup".
compute_public()
Generate the ephemeral secret and return the padded 384-byte public value A.
compute_proof($salt, $B_bytes)
Derive the session key from the server's salt and public key B, and return the client proof M1. Returns undef if B mod N == 0.
verify_server_proof($M2)
True iff $M2 equals H(PAD(A) | M1 | K).
session_key()
The 64-byte shared session key K, available after "compute_proof".
SEE ALSO
OpenHAP::Test::Controller, OpenHAP::SRP, spec/HAP-Pairing.md
| 2026-07-27 | OpenBSD |