45 #define CNONCE_ENTROPY_BYTES 18
98 _gsasl_scram_sha1_client_start (
Gsasl_session *sctx,
void **mech_data)
104 _gsasl_scram_sha1_plus_client_start (
Gsasl_session *sctx,
void **mech_data)
110 #ifdef USE_SCRAM_SHA256
112 _gsasl_scram_sha256_client_start (
Gsasl_session *sctx,
void **mech_data)
118 _gsasl_scram_sha256_plus_client_start (
Gsasl_session *sctx,
void **mech_data)
127 const char *input,
size_t input_len,
128 char **output,
size_t *output_len)
141 const char *p, *b64cb;
159 state->
cf.
cbname = strdup (
"tls-exporter");
164 state->
cf.
cbname = strdup (
"tls-unique");
188 *output_len = strlen (*output);
191 p = strchr (*output,
',');
201 state->
cfmb = strdup (p);
206 if (state->
plus && b64cb)
217 len = (p - *output) + cblen;
218 cbind_input = malloc (len);
219 if (cbind_input == NULL)
222 memcpy (cbind_input, *output, p - *output);
223 memcpy (cbind_input + (p - *output), cb, cblen);
259 n = asprintf (&str,
"%zu", state->
sf.
iter);
260 if (n < 0 || str == NULL)
312 serverkey, storedkey);
330 state->
cl.
proof = strdup (
"p");
339 (
int) input_len, input,
340 (
int) (strlen (cfmwp) - 4), cfmwp);
361 memxor (clientproof, clientsignature,
395 *output_len = strlen (*output);
int gsasl_base64_from(const char *in, size_t inlen, char **out, size_t *outlen)
int gsasl_base64_to(const char *in, size_t inlen, char **out, size_t *outlen)
size_t gsasl_hash_length(Gsasl_hash hash)
int gsasl_scram_secrets_from_salted_password(Gsasl_hash hash, const char *salted_password, char *client_key, char *server_key, char *stored_key)
int gsasl_nonce(char *data, size_t datalen)
int gsasl_scram_secrets_from_password(Gsasl_hash hash, const char *password, unsigned int iteration_count, const char *salt, size_t saltlen, char *salted_password, char *client_key, char *server_key, char *stored_key)
@ GSASL_NO_CB_TLS_EXPORTER
@ GSASL_AUTHENTICATION_ERROR
@ GSASL_MECHANISM_CALLED_TOO_MANY_TIMES
@ GSASL_MECHANISM_PARSE_ERROR
_GSASL_API int gsasl_property_set(Gsasl_session *sctx, Gsasl_property prop, const char *data)
_GSASL_API const char * gsasl_property_get(Gsasl_session *sctx, Gsasl_property prop)
@ GSASL_SCRAM_SALTED_PASSWORD
_GSASL_API int gsasl_saslprep(const char *in, Gsasl_saslprep_flags flags, char **out, int *stringpreprc)
#define CNONCE_ENTROPY_BYTES
int _gsasl_scram_client_step(Gsasl_session *sctx, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
void _gsasl_scram_client_finish(Gsasl_session *sctx _GL_UNUSED, void *mech_data)
int scram_parse_server_final(const char *str, size_t len, struct scram_server_final *sl)
int scram_parse_server_first(const char *str, size_t len, struct scram_server_first *sf)
int scram_print_client_first(struct scram_client_first *cf, char **out)
int scram_print_client_final(struct scram_client_final *cl, char **out)
void gsasl_free(void *ptr)
struct scram_client_first cf
struct scram_server_final sl
struct scram_client_final cl
struct scram_server_first sf
void scram_free_server_first(struct scram_server_first *sf)
void scram_free_client_first(struct scram_client_first *cf)
void scram_free_server_final(struct scram_server_final *sl)
void scram_free_client_final(struct scram_client_final *cl)