mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-14 04:18:54 +03:00
crytpo: Make sure we check return of ssh_get_random() correctly
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -90,9 +90,15 @@ static int server_set_kex(ssh_session session) {
|
||||
char hostkeys[64] = {0};
|
||||
enum ssh_keytypes_e keytype;
|
||||
size_t len;
|
||||
int ok;
|
||||
|
||||
ZERO_STRUCTP(server);
|
||||
ssh_get_random(server->cookie, 16, 0);
|
||||
|
||||
ok = ssh_get_random(server->cookie, 16, 0);
|
||||
if (!ok) {
|
||||
ssh_set_error(session, SSH_FATAL, "PRNG error");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (session->srv.ed25519_key != NULL) {
|
||||
snprintf(hostkeys,
|
||||
|
||||
Reference in New Issue
Block a user