From 64af76e2bef2565caa9738f675c108a4b3789237 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 18 Oct 2012 18:43:56 -0400 Subject: Change pam data auth tokens. Use the new authtok abstraction and interfaces throught the code. --- src/tests/krb5_child-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/tests') 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; -- cgit