461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha authtok - Utilities tests
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha Pallavi Jha <pallavikumarijha@gmail.com>
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha Copyright (C) 2013 Red Hat
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha This program is free software; you can redistribute it and/or modify
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha it under the terms of the GNU General Public License as published by
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha the Free Software Foundation; either version 3 of the License, or
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha (at your option) any later version.
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha This program is distributed in the hope that it will be useful,
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha but WITHOUT ANY WARRANTY; without even the implied warranty of
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha GNU General Public License for more details.
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha You should have received a copy of the GNU General Public License
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha along with this program. If not, see <http://www.gnu.org/licenses/>.
80b5dbe123ec94c5a8fcb99f9a4953c1513deb58Sumit Bose ts = talloc(global_talloc_context, struct test_state);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha struct test_state *ts = talloc_get_type_abort(*state, struct test_state);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha struct test_state *ts = talloc_get_type_abort(*state, struct test_state);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha/* @test_authtok_type_x : tests following functions for different value of type
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_set
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_get_type
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_get_size
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_get_data
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_get_password
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * sss_authtok_get_ccfile
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * @test_authtok_type_password : type => SSS_AUTHTOK_TYPE_PASSWORD
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * @test_authtok_type_ccfile : type => SSS_AUTHTOK_TYPE_CCFILE
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha * @test_authtok_type_empty : type => SSS_AUTHTOK_TYPE_EMPTY
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha/* Test when type has value SSS_AUTHTOK_TYPE_PASSWORD */
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jhastatic void test_sss_authtok_password(void **state)
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ts = talloc_get_type_abort(*state, struct test_state);
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(len, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_string_equal(data, sss_authtok_get_data(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_password(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_set_password(ts->authtoken, data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_password(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha/* Test when type has value SSS_AUTHTOK_TYPE_CCFILE */
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jhastatic void test_sss_authtok_ccfile(void **state)
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ts = talloc_get_type_abort(*state, struct test_state);
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(len, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_string_equal(data, sss_authtok_get_data(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_ccfile(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_set_ccfile(ts->authtoken, data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_ccfile(ts->authtoken, &pwd, &ret_len);
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *) data, 0);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(len, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_string_equal(data, sss_authtok_get_data(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_ccfile(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha/* Test when type has value SSS_AUTHTOK_TYPE_EMPTY */
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ts = talloc_get_type_abort(*state, struct test_state);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_set(ts->authtoken, type, NULL, 0);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(0, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_null(sss_authtok_get_data(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_password(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_ccfile(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(0, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_null(sss_authtok_get_data(ts->authtoken));
8c4aeae19dbb436c17b5f4032285adbaed727eeaLukas Slebodnik ret = sss_authtok_set(ts->authtoken, type, (const uint8_t*)"", 0);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(EOK, sss_authtok_get_size(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_null(sss_authtok_get_data(ts->authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_password(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_ccfile(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jhastatic void test_sss_authtok_wipe_password(void **state)
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ts = talloc_get_type_abort(*state, struct test_state);
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_get_password(ts->authtoken, &pwd, &ret_len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ts= talloc_get_type_abort(*state, struct test_state);
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(EOK, sss_authtok_copy(ts->authtoken, dest_authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(dest_authtoken));
4b8021779e4db2a212a8214c17e778e843ae2b3aStef Walter ret = sss_authtok_set(ts->authtoken, type, (const uint8_t *)data, len);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha ret = sss_authtok_copy(ts->authtoken, dest_authtoken);
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(type, sss_authtok_get_type(dest_authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_string_equal(data, sss_authtok_get_data(dest_authtoken));
461da2984c747708e8badd27fa55ef879f40e712Pallavi Jha assert_int_equal(len, sss_authtok_get_size(dest_authtoken));
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ts = talloc_get_type_abort(*state, struct test_state);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* Test missing first factor */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_2fa(ts->authtoken, NULL, 1, "b", 1);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* Test missing second factor */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_2fa(ts->authtoken, "a", 1, NULL, 1);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* Test wrong first factor length */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_2fa(ts->authtoken, "ab", 1, "b", 1);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* Test wrong second factor length */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_2fa(ts->authtoken, "a", 1, "bc", 1);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_2fa(ts->authtoken, "a", 1, "bc", 2);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_int_equal(sss_authtok_get_size(ts->authtoken),
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_int_equal(sss_authtok_get_type(ts->authtoken), SSS_AUTHTOK_TYPE_2FA);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose "\2\0\0\0\3\0\0\0a\0bc\0",
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose "\0\0\0\2\0\0\0\3a\0bc\0",
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_get_2fa(ts->authtoken, &fa1, &fa1_size, &fa2, &fa2_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* check return code of empty token */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_get_2fa(ts->authtoken, &fa1, &fa1_size, &fa2, &fa2_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* check return code for other token type */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set_password(ts->authtoken, "abc", 0);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_get_2fa(ts->authtoken, &fa1, &fa1_size, &fa2, &fa2_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose /* check return code for garbage */
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_authtok_set(ts->authtoken, SSS_AUTHTOK_TYPE_2FA,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ts = talloc_get_type_abort(*state, struct test_state);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob(NULL, 0, "defg", 0, NULL, 0, &needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob("abc", 0, NULL, 0, NULL, 0, &needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob("", 0, "defg", 0, NULL, 0, &needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob("abc", 0, "", 0, NULL, 0, &needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob("abc", 0, "defg", 0, NULL, 0, &needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_pack_2fa_blob("abc", 0, "defg", 0, buf, needed_size,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_memory_equal(buf, "\4\0\0\0\5\0\0\0abc\0defg\0", needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose assert_memory_equal(buf, "\0\0\0\4\0\0\0\5abc\0defg\0", needed_size);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_unpack_2fa_blob(ts, buf, needed_size, &fa1, &fa1_len, &fa2,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ts = talloc_get_type_abort(*state, struct test_state);
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_auth_pack_sc_blob("abc", 0, "defg", 0, "hijkl", 0, "mnopqr", 0,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_auth_pack_sc_blob("abc", 0, "defg", 0, "hijkl", 0, "mnopqr", 0,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose assert_memory_equal(buf, "\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0abc\0defg\0hijkl\0mnopqr\0",
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose assert_memory_equal(buf, "\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7abc\0defg\0hijkl\0mnopqr\0",
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_authtok_set(ts->authtoken, SSS_AUTHTOK_TYPE_SC_PIN, buf,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_authtok_get_sc(ts->authtoken, &pin, &pin_len,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_authtok_get_sc(ts->authtoken, NULL, NULL,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose ret = sss_authtok_get_sc(ts->authtoken, NULL, NULL,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bosevoid test_sss_authtok_2fa_blobs_missing_null(void **state)
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b0[] = {0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 'a', 'b', 'c', 0x00, 'd', 'e', 'f', 'g', 0x00};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b1[] = {0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 0x00};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b2[] = {0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 'a', 'b', 'c', 0x00, 'd', 'e', 'f', 'g'};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b3[] = {0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 'a', 'b', 'c', 'd', 'e', 'f', 'g'};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b0[] = {0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 'a', 'b', 'c', 0x00, 'd', 'e', 'f', 'g', 0x00};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b1[] = {0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 0x00};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b2[] = {0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 'a', 'b', 'c', 0x00, 'd', 'e', 'f', 'g'};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose uint8_t b3[] = {0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 'a', 'b', 'c', 'd', 'e', 'f', 'g'};
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ts = talloc_get_type_abort(*state, struct test_state);
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_unpack_2fa_blob(ts, b0, sizeof(b0), &fa1, &fa1_len, &fa2,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_unpack_2fa_blob(ts, b1, sizeof(b1), &fa1, &fa1_len, &fa2,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_unpack_2fa_blob(ts, b2, sizeof(b2), &fa1, &fa1_len, &fa2,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose ret = sss_auth_unpack_2fa_blob(ts, b3, sizeof(b3), &fa1, &fa1_len, &fa2,
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ts = talloc_get_type_abort(*state, struct test_state);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose assert_int_equal(sss_authtok_get_type(ts->authtoken),
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose assert_int_equal(sss_authtok_get_size(ts->authtoken), 0);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose assert_null(sss_authtok_get_data(ts->authtoken));
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ts = talloc_get_type_abort(*state, struct test_state);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_set_sc_pin(ts->authtoken, NULL, 0);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_set_sc_pin(ts->authtoken, "12345678", 0);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose assert_int_equal(sss_authtok_get_type(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose "\11\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0" "12345678\0\0\0\0",
bc07967636135e48252198936ac8975510918e99Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose "\0\0\0\11\0\0\0\1\0\0\0\1\0\0\0\1" "12345678\0\0\0\0",
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_set_sc_pin(ts->authtoken, "12345678", 5);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose assert_int_equal(sss_authtok_get_type(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose "\6\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0" "12345\0\0\0\0",
bc07967636135e48252198936ac8975510918e99Sumit Bose assert_memory_equal(sss_authtok_get_data(ts->authtoken),
bc07967636135e48252198936ac8975510918e99Sumit Bose "\0\0\0\6\0\0\0\1\0\0\0\1\0\0\0\1" "12345\0\0\0\0",
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_get_sc_pin(ts->authtoken, &pin, &len);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_get_sc_pin(ts->authtoken, &pin, &len);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_set_password(ts->authtoken, "12345", 0);
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose ret = sss_authtok_get_sc_pin(ts->authtoken, &pin, &len);
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_new,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_password,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_ccfile,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_empty,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_wipe_password,
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek cmocka_unit_test_setup_teardown(test_sss_authtok_copy,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_2fa,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_2fa_blobs,
bc052ea17d858c19f9cb9c9e2bc602e754f68831Sumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_2fa_blobs_missing_null,
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_sc_keypad,
10703cd558016685ee778e333f1d4490238d46e7Sumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_sc_pin,
dd17a3aaddab6f122dff3bd15b7005464c07c0eaSumit Bose cmocka_unit_test_setup_teardown(test_sss_authtok_sc_blobs,
57c5ea8825c7179fd93382dbcbb07e828e5aec19René Genz /* Set debug level to invalid value so we can decide if -d 0 was used. */
80b5dbe123ec94c5a8fcb99f9a4953c1513deb58Sumit Bose pc = poptGetContext(argv[0], argc, argv, long_options, 0);