diff options
Diffstat (limited to 'src/rexmpp_openpgp.c')
-rw-r--r-- | src/rexmpp_openpgp.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/rexmpp_openpgp.c b/src/rexmpp_openpgp.c index 3e71169..09b2b4e 100644 --- a/src/rexmpp_openpgp.c +++ b/src/rexmpp_openpgp.c @@ -48,6 +48,7 @@ Possible future improvements: #include <gpgme.h> #endif #include <libxml/tree.h> +#include <gcrypt.h> #include <gsasl.h> #include "rexmpp.h" @@ -755,14 +756,9 @@ char *rexmpp_openpgp_payload (rexmpp_t *s, /* A random-length random-content padding. */ char *rand_str, rand[256]; - gsasl_nonce(rand, 1); + gcry_create_nonce(rand, 1); size_t rand_str_len = 0, rand_len = (unsigned char)rand[0] % (255 - 16) + 16; - sasl_err = gsasl_nonce(rand, rand_len); - if (sasl_err != GSASL_OK) { - rexmpp_log(s, LOG_ERR, "Random generation failure: %s", - gsasl_strerror(sasl_err)); - return NULL; - } + gcry_create_nonce(rand, rand_len); sasl_err = gsasl_base64_to(rand, rand_len, &rand_str, &rand_str_len); if (sasl_err != GSASL_OK) { rexmpp_log(s, LOG_ERR, "Base-64 encoding failure: %s", |