OpenHAP::Test::Controller::SRP(3p) Perl Library Manual OpenHAP::Test::Controller::SRP(3p)

OpenHAP::Test::Controller::SRP - SRP-6a client role for tests

    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';

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).

"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.

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.

True iff $M2 equals H(PAD(A) | M1 | K).

session_key()

The 64-byte shared session key K, available after "compute_proof".

OpenHAP::Test::Controller, OpenHAP::SRP, spec/HAP-Pairing.md

2026-07-27 OpenBSD