summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-10 06:30:12 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-10 11:25:07 +0200
commit0bdca5d51f203cf414d645e75ac197e3fadfadc8 (patch)
tree7b5fa4da6036db39fe7f6158f4664f6a279ec34e /lib
parent9509af0e791b74538de8ffa8dd0d47c05cb08eed (diff)
downloadgnutls-0bdca5d51f203cf414d645e75ac197e3fadfadc8.tar.gz
_gnutls_srp_entry_free: follow consistent behavior in freeing datatmp-fix-srp
_gnutls_srp_entry_free would previously not free any parameters that were known to gnutls to account for documented behavior of gnutls_srp_set_server_credentials_function(). This was not updated when the newly added 8192 parameter was added to the library. This introduces a safety check for generator parameters, even though in practice they are the same pointer. Resolves: #761 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/auth/srp_passwd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/auth/srp_passwd.c b/lib/auth/srp_passwd.c
index ad1937c962..6902be3d26 100644
--- a/lib/auth/srp_passwd.c
+++ b/lib/auth/srp_passwd.c
@@ -447,20 +447,24 @@ void _gnutls_srp_entry_free(SRP_PWD_ENTRY * entry)
_gnutls_free_key_datum(&entry->v);
_gnutls_free_datum(&entry->salt);
- if ((entry->g.data != gnutls_srp_1024_group_generator.data)
- && (entry->g.data != gnutls_srp_3072_group_generator.data))
+ if ((entry->g.data != gnutls_srp_1024_group_generator.data) &&
+ (entry->g.data != gnutls_srp_1536_group_generator.data) &&
+ (entry->g.data != gnutls_srp_2048_group_generator.data) &&
+ (entry->g.data != gnutls_srp_3072_group_generator.data) &&
+ (entry->g.data != gnutls_srp_4096_group_generator.data) &&
+ (entry->g.data != gnutls_srp_8192_group_generator.data))
_gnutls_free_datum(&entry->g);
if (entry->n.data != gnutls_srp_1024_group_prime.data &&
entry->n.data != gnutls_srp_1536_group_prime.data &&
entry->n.data != gnutls_srp_2048_group_prime.data &&
entry->n.data != gnutls_srp_3072_group_prime.data &&
- entry->n.data != gnutls_srp_4096_group_prime.data)
+ entry->n.data != gnutls_srp_4096_group_prime.data &&
+ entry->n.data != gnutls_srp_8192_group_prime.data)
_gnutls_free_datum(&entry->n);
gnutls_free(entry->username);
gnutls_free(entry);
}
-
#endif /* ENABLE SRP */