示例#1
0
TEST(SKF_ACCESS_CONTROL,SKF_UnbolckPIN_Test)
{
    ULONG result;
    ULONG *pulAdminRemainRetryCount = new ULONG();

    SKF_UnblockPIN skf_unblockPIN = SKF_UnblockPIN(GetProcAddress(hmodule,"SKF_UnblockPIN"));
    result = skf_unblockPIN(hApplication,"88888888","11111111",pulAdminRemainRetryCount);
    EXPECT_EQ(0,(int)result);
}
示例#2
0
BOOL CAuthTest::Test_UnblockPIN()
{
    SHOW_PROCESS("UnblockPIN");
    if (NULL == g_hApp)
    {
        printf("OPen application first!\n");
        return FALSE;
    }

    char szSoPIN[256] = {0};
    printf("Input administrator's PIN\n");

    fflush(stdin);
    gets(szSoPIN);


    char szNewUserPIN[256] = {0};
    printf("Input new user's PIN\n");

    fflush(stdin);
    gets(szNewUserPIN);

    ULONG ulRetryCount = 0;
    ULONG ulReval = 0;
    do
    {
        ulReval = SKF_UnblockPIN(g_hApp, (LPSTR)szSoPIN, (LPSTR)szNewUserPIN, &ulRetryCount);
        SHOW_ERROR(ulReval);
        if (SAR_PIN_INCORRECT == ulReval)
        {
            printf("Wrong PIN!\n");
            break;
        }

        if (SAR_PIN_INVALID == ulReval)
        {
            printf("Invalid PIN!\n");
            break;
        }

        if (SAR_PIN_LEN_RANGE == ulReval)
        {
            printf("Wrong PIN Length!\n");
            break;
        }

        if (SAR_PIN_LOCKED == ulReval)
        {
            printf("Your PIN has been locked!\n");
            break;
        }
    } while (0);

    return (SAR_OK == ulReval);
}