@@ -26,8 +26,12 @@ class SteamGuardTest extends AuthenticatorInterfaceTestAbstract{
2626
2727 protected const secret = 'MTIzNDU2Nzg5MDEyMzQ1Njc4OTA= ' ;
2828
29+ /**
30+ * Timestamps and -slices from the RFC6238 page, codes from a verified implementation
31+ *
32+ * @see https://tools.ietf.org/html/rfc6238#page-14
33+ */
2934 protected const SteamGuardVectors = [
30- // timestamps and time slices from RFC 6238, see https://tools.ietf.org/html/rfc6238#page-14
3135 [ 59 , '1 ' , 'PV9M4 ' ],
3236 [ 1111111109 , '23523ec ' , 'PY4YB ' ],
3337 [ 1111111111 , '23523ed ' , '5PP3V ' ],
@@ -51,6 +55,16 @@ public function setGetSecret():void{
5155 $ this ::assertSame ($ this ::rawsecret, Base64::decode ($ secret ));
5256 }
5357
58+ #[Test]
59+ public function setGetRawSecret ():void {
60+ $ this ->authenticatorInterface ->setRawSecret ($ this ::rawsecret);
61+
62+ $ secret = $ this ->authenticatorInterface ->getRawSecret ();
63+
64+ $ this ::assertSame ($ this ::secret, Base64::encode ($ secret ));
65+ $ this ::assertSame ($ this ::rawsecret, $ secret );
66+ }
67+
5468 #[Test]
5569 public function createSecretDefaultLength ():void {
5670 $ this ::assertSame (
@@ -77,11 +91,6 @@ public function createSecretCheckCharacterSet():void{
7791 $ this ::assertMatchesRegularExpression ('#^[ ' .Base64::CHARSET .']+$# ' , $ secret );
7892 }
7993
80- /**
81- * Timestamps and -slices from the RFC6238 page, codes from a verified implementation
82- *
83- * @see https://tools.ietf.org/html/rfc6238#page-14
84- */
8594 public static function steamGuardVectors ():Generator {
8695 foreach (self ::SteamGuardVectors as [$ timestamp , $ timeslice , $ totp ]){
8796 // skip 64bit numbers on 32bit PHP
0 commit comments