Remove mud_new_key()
This commit is contained in:
14
mud.c
14
mud.c
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user