diff options
author | djm@openbsd.org <djm@openbsd.org> | 2019-01-21 10:54:11 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-01-21 11:47:28 +0100 |
commit | 7be8572b32a15d5c3dba897f252e2e04e991c307 (patch) | |
tree | 449782dce059d2eb8d28aaa3baeaedd876b915a2 /monitor_wrap.c | |
parent | upstream: remove obsolete (SSH v.1) sshbuf_get/put_bignum1 (diff) | |
download | openssh-7be8572b32a15d5c3dba897f252e2e04e991c307.tar.xz openssh-7be8572b32a15d5c3dba897f252e2e04e991c307.zip |
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.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index 9e3c7cd17..186e8f022 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)); |