Skip to content

Conversation

@erikn69
Copy link
Contributor

@erikn69 erikn69 commented Jan 21, 2026

Closes #129

The asn1::utime() function in src/helpers/asn1.php expects a date with yymmddhhiiss format,
but date() 2nd arg expects Unix timestamp (?int) as input:
date(string $format, ?int $timestamp = null): string php.net/function.date.php

if($func == 'utime') {
    $time = $params[0]; //yymmddhhiiss
    $oldTz = date_default_timezone_get();
    date_default_timezone_set("UTC");
    $time = date("ymdHis", $time);  // <-- Expects $time to be Unix timestamp, gets yymmddhhiiss string
    date_default_timezone_set($oldTz);
    $val = bin2hex($time."Z");
}

asn1::utime(date("ymdHis")) //UTTC Time

sapp/src/helpers/asn1.php

Lines 233 to 236 in 2e8a56c

$time = $params[0]; //yymmddhhiiss
$oldTz = date_default_timezone_get();
date_default_timezone_set("UTC");
$time = date("ymdHis", $time);

Replace date function with DateTime for timestamp conversion.
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

Successfully merging this pull request may close these issues.

[CRITICAL] Digital signatures fail validation - Invalid SigningTime in CMS/PKCS#7 structure

1 participant