summaryrefslogtreecommitdiff
path: root/src/tests/krb5_child-test.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-10-18 18:43:56 -0400
committerSimo Sorce <simo@redhat.com>2013-01-10 12:24:59 -0500
commit64af76e2bef2565caa9738f675c108a4b3789237 (patch)
treefa24e7f17f07136494a4c515c63b8795be7130e4 /src/tests/krb5_child-test.c
parent918b2a5a91f1c551d48f4bffed2a28c36fdb4be1 (diff)
downloadsssd-64af76e2bef2565caa9738f675c108a4b3789237.tar.gz
sssd-64af76e2bef2565caa9738f675c108a4b3789237.tar.bz2
sssd-64af76e2bef2565caa9738f675c108a4b3789237.zip
Change pam data auth tokens.
Use the new authtok abstraction and interfaces throught the code.
Diffstat (limited to 'src/tests/krb5_child-test.c')
-rw-r--r--src/tests/krb5_child-test.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tests/krb5_child-test.c b/src/tests/krb5_child-test.c
index 34d025b7..a72a3519 100644
--- a/src/tests/krb5_child-test.c
+++ b/src/tests/krb5_child-test.c
@@ -167,6 +167,9 @@ create_dummy_pam_data(TALLOC_CTX *mem_ctx, const char *user,
const char *password)
{
struct pam_data *pd;
+ const char *authtok;
+ size_t authtok_len;
+ errno_t ret;
pd = talloc_zero(mem_ctx, struct pam_data);
if (!pd) goto fail;
@@ -175,12 +178,12 @@ create_dummy_pam_data(TALLOC_CTX *mem_ctx, const char *user,
pd->user = talloc_strdup(pd, user);
if (!pd->user) goto fail;
- pd->authtok = discard_const(talloc_strdup(pd, password));
- if (!pd->authtok) goto fail;
- pd->authtok_size = strlen(password);
- pd->authtok_type = SSS_AUTHTOK_TYPE_PASSWORD;
+ ret = sss_authtok_set_password(pd, &pd->authtok, password, 0);
+ if (ret) goto fail;
+
+ (void)sss_authtok_get_password(&pd->authtok, &authtok, &authtok_len);
DEBUG(SSSDBG_FUNC_DATA, ("Authtok [%s] len [%d]\n",
- pd->authtok, pd->authtok_size));
+ authtok, (int)authtok_len));
return pd;