Introduced PRNG based on Hash_DRBG (NIST SP 800-90A)

This pseudo-random number generator solves problem with
platform-independent generation of randomized nonces.
Current implementation uses weak entropy, especially when
kernel.randomize_va_space = 0. But it can be improved by
adding new sources to xmpp_rand_reseed().

New internal API introduced:
  xmpp_rand_new
  xmpp_rand_free
  xmpp_rand
  xmpp_rand_bytes
  xmpp_rand_nonce
This commit is contained in:
Dmitry Podgorny
2014-09-08 15:05:51 +03:00
parent 75b1a633d6
commit 10656ead46
7 changed files with 366 additions and 28 deletions

View File

@@ -27,6 +27,7 @@
#include "hash.h"
#include "util.h"
#include "parser.h"
#include "rand.h"
/** run-time context **/
@@ -45,6 +46,7 @@ struct _xmpp_ctx_t {
const xmpp_mem_t *mem;
const xmpp_log_t *log;
xmpp_rand_t *rand;
xmpp_loop_status_t loop_status;
xmpp_connlist_t *connlist;
};