summaryrefslogtreecommitdiff
path: root/lib/auth
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-27 15:16:52 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2019-05-28 16:43:33 +0200
commit230a39a73aca2d40626d576e5f537a04b045beee (patch)
treefce29d6595a1efd78c8b54d50ee1027f6b0f2d3c /lib/auth
parentb64627cdaeb74afc109d9ae38a18c0b6909be59b (diff)
downloadgnutls-230a39a73aca2d40626d576e5f537a04b045beee.tar.gz
Remove malloc from gnutls_srp_set_server_fake_salt_seed()tmp-datum-cleanup
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib/auth')
-rw-r--r--lib/auth/srp_kx.h6
-rw-r--r--lib/auth/srp_passwd.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/auth/srp_kx.h b/lib/auth/srp_kx.h
index e4431ee28e..ebe1477e02 100644
--- a/lib/auth/srp_kx.h
+++ b/lib/auth/srp_kx.h
@@ -25,6 +25,8 @@
#include <auth.h>
+#define MAX_FAKE_SALT_SEED_SIZE 64
+
typedef struct gnutls_srp_client_credentials_st {
char *username;
char *password;
@@ -38,7 +40,9 @@ typedef struct gnutls_srp_server_credentials_st {
* password files.
*/
gnutls_srp_server_credentials_function *pwd_callback;
- gnutls_datum_t fake_salt_seed;
+ unsigned char fake_salt_seed[MAX_FAKE_SALT_SEED_SIZE];
+ unsigned int fake_salt_seed_size;
+
unsigned int fake_salt_length;
} srp_server_cred_st;
diff --git a/lib/auth/srp_passwd.c b/lib/auth/srp_passwd.c
index 6902be3d26..6cd3f7e524 100644
--- a/lib/auth/srp_passwd.c
+++ b/lib/auth/srp_passwd.c
@@ -418,8 +418,8 @@ static int _randomize_pwd_entry(SRP_PWD_ENTRY * entry,
return GNUTLS_E_MEMORY_ERROR;
}
- ret = _gnutls_mac_init(&ctx, me, sc->fake_salt_seed.data,
- sc->fake_salt_seed.size);
+ ret = _gnutls_mac_init(&ctx, me, sc->fake_salt_seed,
+ sc->fake_salt_seed_size);
if (ret < 0) {
gnutls_assert();