Files
SGF/scripts/verify-protected-transport.php

10 lines
598 B
PHP

<?php
require __DIR__.'/../vendor/autoload.php';
try {
[$password, $confirmation] = \App\Modules\Identity\Services\ProtectedProvisioningInput::read(STDIN, 'synthetic@example.test');
$expected = getenv('SGF_SYNTHETIC_HASH');
if (! is_string($expected) || $expected === '' || ! hash_equals($expected, hash('sha256', $password)) || $password !== $confirmation) { exit(1); }
echo "Protected PowerShell-to-PHP transport: OK (synthetic input, no database writes).\n";
} catch (\Throwable) { fwrite(STDERR, "Protected transport verification failed; payload not displayed.\n"); exit(1); }