From 3ef79e28b4996750a07874f80282acc0351ef675 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Fri, 22 Jul 2016 14:23:31 -0400 Subject: Fix behavior of NULL ccname for cookie creation This resolves an issue where the session cookie would not be populated when sesions were used but unique ccaches were not. Based on a report from Bhagavan Das. Signed-off-by: Robbie Harwood Reviewed-by: Simo Sorce Closes #98 --- src/sessions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sessions.c b/src/sessions.c index 03efc89..4043496 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -236,8 +236,13 @@ void mag_attempt_session(struct mag_req_cfg *cfg, struct mag_conn *mc) (const char *)mc->basic_hash.value, mc->basic_hash.length) != 0) goto done; - if (OCTET_STRING_fromString(&gsessdata.ccname, mc->ccname) != 0) + + /* NULL ccname here just means default ccache */ + if (mc->ccname && + OCTET_STRING_fromString(&gsessdata.ccname, mc->ccname) != 0) { goto done; + } + ret = encode_GSSSessionData(req->pool, &gsessdata, &plainbuf.value, &plainbuf.length); if (ret == false) { -- cgit