diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2023-03-06 12:14:48 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2023-03-06 23:31:52 +1100 |
commit | 9641753e0fd146204d57b2a4165f552a81afade4 (patch) | |
tree | 78feed3f9ff1590ae36a14355b308e887e881273 /compat.c | |
parent | aa59d6a489fb20973fa461d0fdb1110db412947b (diff) | |
download | openssh-git-9641753e0fd146204d57b2a4165f552a81afade4.tar.gz |
upstream: Refactor creation of KEX proposal.
This adds kex_proposal_populate_entries (and corresponding free) which
populates the KEX proposal array with dynamically allocated strings.
This replaces the previous mix of static and dynamic that has been the
source of previous leaks and bugs. Remove unused compat functions.
With & ok djm@.
OpenBSD-Commit-ID: f2f99da4aae2233cb18bf9c749320c5e040a9c7b
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 19 |
1 files changed, 2 insertions, 17 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.125 2023/02/17 04:22:50 dtucker Exp $ */ +/* $OpenBSD: compat.c,v 1.126 2023/03/06 12:14:48 dtucker Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -36,7 +36,6 @@ #include "compat.h" #include "log.h" #include "match.h" -#include "kex.h" /* determine bug flags from SSH protocol banner */ void @@ -140,21 +139,7 @@ compat_banner(struct ssh *ssh, const char *version) /* Always returns pointer to allocated memory, caller must free. */ char * -compat_cipher_proposal(struct ssh *ssh, char *cipher_prop) -{ - return xstrdup(cipher_prop); -} - -/* Always returns pointer to allocated memory, caller must free. */ -char * -compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop) -{ - return xstrdup(pkalg_prop); -} - -/* Always returns pointer to allocated memory, caller must free. */ -char * -compat_kex_proposal(struct ssh *ssh, char *p) +compat_kex_proposal(struct ssh *ssh, const char *p) { char *cp = NULL, *cp2 = NULL; |