summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-01-21 09:54:11 +0000
committerDamien Miller <djm@mindrot.org>2019-01-21 21:47:28 +1100
commit7be8572b32a15d5c3dba897f252e2e04e991c307 (patch)
tree449782dce059d2eb8d28aaa3baeaedd876b915a2 /monitor_wrap.c
parent803178bd5da7e72be94ba5b4c4c196d4b542da4d (diff)
downloadopenssh-git-7be8572b32a15d5c3dba897f252e2e04e991c307.tar.gz
upstream: Make sshpkt_get_bignum2() allocate the bignum it is
parsing rather than make the caller do it. Saves a lot of boilerplate code. from markus@ ok djm@ OpenBSD-Commit-ID: 576bf784f9a240f5a1401f7005364e59aed3bce9
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 9e3c7cd1..186e8f02 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.111 2019/01/19 21:43:56 djm Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.112 2019/01/21 09:54:11 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -202,12 +202,8 @@ mm_choose_dh(int min, int nbits, int max)
if (success == 0)
fatal("%s: MONITOR_ANS_MODULI failed", __func__);
- if ((p = BN_new()) == NULL)
- fatal("%s: BN_new failed", __func__);
- if ((g = BN_new()) == NULL)
- fatal("%s: BN_new failed", __func__);
- if ((r = sshbuf_get_bignum2(m, p)) != 0 ||
- (r = sshbuf_get_bignum2(m, g)) != 0)
+ if ((r = sshbuf_get_bignum2(m, &p)) != 0 ||
+ (r = sshbuf_get_bignum2(m, &g)) != 0)
fatal("%s: buffer error: %s", __func__, ssh_err(r));
debug3("%s: remaining %zu", __func__, sshbuf_len(m));