aboutsummaryrefslogtreecommitdiff
path: root/src/packet.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-07-05 10:47:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-07-05 12:12:14 +0200
commitc503bb572eee1a166ce5e631785b7d24e6319605 (patch)
tree6ab8c088fe5f2764fffe91ef9ea9d9640cf63ed1 /src/packet.c
parent36a727e656a7fcd91722cf2d050fc87d55410b5b (diff)
downloadlibssh-c503bb572eee1a166ce5e631785b7d24e6319605.tar.gz
libssh-c503bb572eee1a166ce5e631785b7d24e6319605.tar.xz
libssh-c503bb572eee1a166ce5e631785b7d24e6319605.zip
crytpo: Make sure we check return of ssh_get_random() correctly
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/packet.c')
-rw-r--r--src/packet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/packet.c b/src/packet.c
index 62250e4d..16f96149 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -579,7 +579,13 @@ static int packet_send2(ssh_session session) {
}
if (session->current_crypto != NULL) {
- ssh_get_random(padstring, padding, 0);
+ int ok;
+
+ ok = ssh_get_random(padstring, padding, 0);
+ if (!ok) {
+ ssh_set_error(session, SSH_FATAL, "PRNG error");
+ goto error;
+ }
}
if (header_buffer == NULL){