Refactor rand

* Removed dependency from internal headers in rand.h. xmpp_rand
  interface can be public in the future;
* xmpp_rand functions accept xmpp_rand_t object instead of xmpp_ctx_t.
This commit is contained in:
Dmitry Podgorny
2016-04-29 14:18:43 +00:00
parent 063f4deb22
commit b5d9b33b6f
5 changed files with 68 additions and 43 deletions

View File

@@ -252,7 +252,7 @@ char *sasl_digest_md5(xmpp_ctx_t *ctx, const char *challenge,
/* add our response fields */
hash_add(table, "username", xmpp_strdup(ctx, node));
xmpp_rand_nonce(ctx, cnonce, sizeof(cnonce));
xmpp_rand_nonce(ctx->rand, cnonce, sizeof(cnonce));
hash_add(table, "cnonce", xmpp_strdup(ctx, cnonce));
hash_add(table, "nc", xmpp_strdup(ctx, "00000001"));
hash_add(table, "qop", xmpp_strdup(ctx, "auth"));