34 #define PASSCODE "passcode"
42 step = (
int *) malloc (
sizeof (*step));
58 char **output,
size_t *output_len)
60 int *step = mech_data;
61 const char *authzid = NULL, *authid = NULL, *passcode = NULL, *pin = NULL;
62 size_t authzidlen, authidlen, passcodelen, pinlen = 0;
69 if (input_len == strlen (
PASSCODE) &&
74 else if (input_len >= strlen (
PIN) &&
75 memcmp (input,
PIN, strlen (
PIN)) == 0)
91 authzidlen = strlen (authzid);
98 authidlen = strlen (authid);
103 passcodelen = strlen (passcode);
107 if (input_len > strlen (
PIN))
110 &input[strlen (
PIN)],
111 input_len - strlen (
PIN));
119 pinlen = strlen (pin);
122 *output_len = authzidlen + 1 + authidlen + 1 + passcodelen + 1;
124 *output_len += pinlen + 1;
125 *output = malloc (*output_len);
130 memcpy (*output, authzid, authzidlen);
131 (*output)[authzidlen] =
'\0';
132 memcpy (*output + authzidlen + 1, authid, authidlen);
133 (*output)[authzidlen + 1 + authidlen] =
'\0';
134 memcpy (*output + authzidlen + 1 + authidlen + 1, passcode,
136 (*output)[authzidlen + 1 + authidlen + 1 + passcodelen] =
'\0';
139 memcpy (*output + authzidlen + 1 + authidlen + 1 + passcodelen + 1,
141 (*output)[authzidlen + 1 + authidlen + 1 + passcodelen + 1 +
167 int *step = mech_data;
@ GSASL_MECHANISM_CALLED_TOO_MANY_TIMES
_GSASL_API int gsasl_property_set_raw(Gsasl_session *sctx, Gsasl_property prop, const char *data, size_t len)
_GSASL_API const char * gsasl_property_get(Gsasl_session *sctx, Gsasl_property prop)
int _gsasl_securid_client_start(Gsasl_session *sctx _GL_UNUSED, void **mech_data)
int _gsasl_securid_client_step(Gsasl_session *sctx, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
void _gsasl_securid_client_finish(Gsasl_session *sctx _GL_UNUSED, void *mech_data)