summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/monitor_wrap.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2019-01-21 09:54:11 +0000
committerdjm <djm@openbsd.org>2019-01-21 09:54:11 +0000
commitf37f3ee23e78db3061951f8cc15291bbef4b09cf (patch)
tree174db40b7acff1092f402685d6208400049486f9 /usr.bin/ssh/monitor_wrap.c
parentremove obsolete (SSH v.1) sshbuf_get/put_bignum1 functions (diff)
downloadwireguard-openbsd-f37f3ee23e78db3061951f8cc15291bbef4b09cf.tar.xz
wireguard-openbsd-f37f3ee23e78db3061951f8cc15291bbef4b09cf.zip
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@
Diffstat (limited to 'usr.bin/ssh/monitor_wrap.c')
-rw-r--r--usr.bin/ssh/monitor_wrap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c
index ac887e9cecb..24cdfa6897e 100644
--- a/usr.bin/ssh/monitor_wrap.c
+++ b/usr.bin/ssh/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>
@@ -197,12 +197,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));