Skip to content

Commit 1443260

Browse files
authored
Merge pull request #1 from elfarmer/main
Update $version value
2 parents 6c103db + a5d67a4 commit 1443260

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpAwsSmtpPassword.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class PhpAwsSmtpPassword
5555
* Per https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html this should never change
5656
* @var string Version to hash with
5757
*/
58-
protected static $version = '[4]';
58+
protected static $version = 0x04;
5959

6060
/**
6161
* Converts a secret key to a password that can be used with SMTP
@@ -75,7 +75,7 @@ public static function convert($key, $region)
7575
$signature = hash_hmac('sha256', PhpAwsSmtpPassword::$service, $signature, true);
7676
$signature = hash_hmac('sha256', PhpAwsSmtpPassword::$terminal, $signature, true);
7777
$signature = hash_hmac('sha256', PhpAwsSmtpPassword::$message, $signature, true);
78-
$signatureAndVersion = PhpAwsSmtpPassword::$version . $signature;
78+
$signatureAndVersion = chr(PhpAwsSmtpPassword::$version) . $signature;
7979

8080
return base64_encode($signatureAndVersion);
8181
}

0 commit comments

Comments
 (0)