Remove mud_new_key()

This commit is contained in:
Adrien Gallouët
2016-06-20 22:11:29 +00:00
parent 29b5a3148d
commit f6df78d016

14
mud.c
View File

@@ -497,15 +497,6 @@ int mud_set_key (struct mud *mud, unsigned char *key, size_t size)
return 0; return 0;
} }
static
int mud_new_key (struct mud *mud)
{
unsigned char key[MUD_KEY_SIZE];
randombytes_buf(key, sizeof(key));
mud_set_key(mud, key, sizeof(key));
}
int mud_set_send_timeout_msec (struct mud *mud, unsigned msec) int mud_set_send_timeout_msec (struct mud *mud, unsigned msec)
{ {
if (!msec) { if (!msec) {
@@ -607,7 +598,10 @@ struct mud *mud_create (int port, int v4, int v6)
mud->send_timeout = MUD_SEND_TIMEOUT; mud->send_timeout = MUD_SEND_TIMEOUT;
mud->time_tolerance = MUD_TIME_TOLERANCE; mud->time_tolerance = MUD_TIME_TOLERANCE;
mud_new_key(mud); unsigned char key[MUD_KEY_SIZE];
randombytes_buf(key, sizeof(key));
mud_set_key(mud, key, sizeof(key));
return mud; return mud;
} }