function testNonStringArrayItem2()
 {
     $otplist[0] = "ff11EE22DD33CC44";
     $otplist[1] = "0123456789AbcDef";
     $otplist[2] = "10fe32dc54ba7694";
     $otplist[3] = "1f11EE22DD33CC44";
     $otplist[4] = array();
     $otplist[5] = "30fe32dc54ba7694";
     $otplist[6] = "4f11EE22DD33CC44";
     $otplist[7] = "5123456789AbcDef";
     $otplist[8] = "60fe32dc54ba7694";
     $otplist[9] = "7f11EE22DD33CC44";
     $otplist[10] = "8123456789AbcDef";
     $otplist[11] = "90fe32dc54ba7694";
     $sixword_list = ivcs_transform_array_to($otplist);
     $this->assertNull($sixword_list[4], "item which is array in the list should return a null item at same element");
 }
Beispiel #2
0
function generate_otp_list()
{
    $S = simplifiedInitialStep();
    $otpList = computationStep($S, __OTPSIZE);
    $firstToBeUsed = $otpList[count($otpList) - 1];
    $initialHash = __otp_hash(hash_wrapper($firstToBeUsed));
    // 1 indicates that the user should use OTP #1 for first access
    //store_hash(1, $initialHash);
    $initial = array();
    $initial['sequence'] = 1;
    $initial['hash'] = $initialHash;
    $otpList = array_reverse($otpList);
    // turn into six-word format so user
    // doesn't have to type a lengthy hex string
    $retval['initial'] = $initial;
    $retval['list'] = ivcs_transform_array_to($otpList);
    unset($retval['list'][0]);
    return $retval;
}