summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-06-21 01:02:20 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-06-21 01:02:20 +0200
commit272a6df983073ebd6329b4aaa831b617f8a66514 (patch)
treea390a1833572c4c0f9652637911dee214510c5ba
parente7a9875b7232b81af32c16258f89c663f455a3e7 (diff)
downloadgnutls-272a6df983073ebd6329b4aaa831b617f8a66514.tar.gz
gnutls_srp_verifier() returns data allocated with gnutls_malloc()
for consistency.
-rw-r--r--NEWS9
-rw-r--r--lib/gnutls_srp.c10
-rw-r--r--lib/gnutls_srp.h2
3 files changed, 14 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index c37c36a302..c58b213d1a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,15 @@ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
See the end for copying conditions.
+* Version (unreleased)
+
+** libgnutls: gnutls_srp_verifier() returns data allocated with gnutls_malloc()
+for consistency.
+
+** API and ABI modifications:
+No changes since last version.
+
+
* Version 2.99.3 (released 2011-06-18)
** libgnutls: Added new PKCS #11 flags to force an object being private or
diff --git a/lib/gnutls_srp.c b/lib/gnutls_srp.c
index be359492b7..e4cab2e471 100644
--- a/lib/gnutls_srp.c
+++ b/lib/gnutls_srp.c
@@ -42,9 +42,9 @@
/* Here functions for SRP (like g^x mod n) are defined
*/
-int
+static int
_gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
- bigint_t g, bigint_t prime, gnutls_alloc_function galloc_func)
+ bigint_t g, bigint_t prime)
{
bigint_t x, e;
size_t result_size;
@@ -71,7 +71,7 @@ _gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
ret = _gnutls_mpi_print (e, NULL, &result_size);
if (ret == GNUTLS_E_SHORT_MEMORY_BUFFER)
{
- *result = galloc_func (result_size);
+ *result = gnutls_malloc (result_size);
if ((*result) == NULL)
return GNUTLS_E_MEMORY_ERROR;
@@ -680,7 +680,7 @@ gnutls_srp_server_get_username (gnutls_session_t session)
* libgcrypt functions gcry_prime_generate() and
* gcry_prime_group_generator().
*
- * The verifier will be allocated with @malloc and will be stored in
+ * The verifier will be allocated with @gnutls_malloc() and will be stored in
* @res using binary format.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, or an
@@ -719,7 +719,7 @@ gnutls_srp_verifier (const char *username, const char *password,
return GNUTLS_E_MPI_SCAN_FAILED;
}
- ret = _gnutls_srp_gx (digest, 20, &res->data, _g, _n, malloc);
+ ret = _gnutls_srp_gx (digest, 20, &res->data, _g, _n);
if (ret < 0)
{
gnutls_assert ();
diff --git a/lib/gnutls_srp.h b/lib/gnutls_srp.h
index 76a257deac..1f9fce798a 100644
--- a/lib/gnutls_srp.h
+++ b/lib/gnutls_srp.h
@@ -25,8 +25,6 @@
#ifdef ENABLE_SRP
-int _gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
- bigint_t g, bigint_t prime, gnutls_alloc_function);
bigint_t _gnutls_calc_srp_B (bigint_t * ret_b, bigint_t g, bigint_t n,
bigint_t v);
bigint_t _gnutls_calc_srp_u (bigint_t A, bigint_t B, bigint_t N);