Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion XS.xs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct authensasl {
char *service;
char *mech;
char *user;
int maxssf;

int error_code;
char *additional_errormsg;
Expand Down Expand Up @@ -1153,6 +1154,25 @@ int init_sasl (SV* parent,char* service,char* host, Authen_SASL_XS *sasl,int cli
}
}

/* Extract maxssf from the parent object */
if (parent && SvROK(parent) && (SvTYPE(SvRV(parent)) == SVt_PVHV))
{
hash = (HV *)SvRV(parent);
hashval = hv_fetch(hash, "maxssf", 6, 0);
if (hashval && SvTYPE(*hashval) == SVt_IV)
{
(*sasl)->maxssf = SvIV(*hashval);
}
else if (hashval && SvTYPE(*hashval) == SVt_NV)
{
(*sasl)->maxssf = SvNV(*hashval);
}
else
{
(*sasl)->maxssf = 0xFF;
}
}

return (*sasl)->error_code;
}

Expand All @@ -1166,7 +1186,7 @@ void set_secprop (Authen_SASL_XS sasl)

memset(&ssp, 0, sizeof(ssp));
ssp.maxbufsize = 0xFFFF;
ssp.max_ssf = 0xFF;
ssp.max_ssf = sasl->maxssf;
sasl_setprop(sasl->conn, SASL_SEC_PROPS, &ssp);
}
#endif
Expand Down