kex.c (294464) | kex.c (294496) |
---|---|
1/* $OpenBSD: kex.c,v 1.109 2015/07/30 00:01:34 djm Exp $ */ 2/* 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 256 unchanged lines hidden (view full) --- 265 goto out; 266 /* extract kex init proposal strings */ 267 for (i = 0; i < PROPOSAL_MAX; i++) { 268 if ((r = sshbuf_get_cstring(b, &(proposal[i]), NULL)) != 0) 269 goto out; 270 debug2("kex_parse_kexinit: %s", proposal[i]); 271 } 272 /* first kex follows / reserved */ | 1/* $OpenBSD: kex.c,v 1.109 2015/07/30 00:01:34 djm Exp $ */ 2/* 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 256 unchanged lines hidden (view full) --- 265 goto out; 266 /* extract kex init proposal strings */ 267 for (i = 0; i < PROPOSAL_MAX; i++) { 268 if ((r = sshbuf_get_cstring(b, &(proposal[i]), NULL)) != 0) 269 goto out; 270 debug2("kex_parse_kexinit: %s", proposal[i]); 271 } 272 /* first kex follows / reserved */ |
273 if ((r = sshbuf_get_u8(b, &v)) != 0 || 274 (r = sshbuf_get_u32(b, &i)) != 0) | 273 if ((r = sshbuf_get_u8(b, &v)) != 0 || /* first_kex_follows */ 274 (r = sshbuf_get_u32(b, &i)) != 0) /* reserved */ |
275 goto out; 276 if (first_kex_follows != NULL) | 275 goto out; 276 if (first_kex_follows != NULL) |
277 *first_kex_follows = i; 278 debug2("kex_parse_kexinit: first_kex_follows %d ", v); 279 debug2("kex_parse_kexinit: reserved %u ", i); | 277 *first_kex_follows = v; 278 debug2("first_kex_follows %d ", v); 279 debug2("reserved %u ", i); |
280 r = 0; 281 *propp = proposal; 282 out: 283 if (r != 0 && proposal != NULL) 284 kex_prop_free(proposal); 285 sshbuf_free(b); 286 return r; 287} --- 628 unchanged lines hidden --- | 280 r = 0; 281 *propp = proposal; 282 out: 283 if (r != 0 && proposal != NULL) 284 kex_prop_free(proposal); 285 sshbuf_free(b); 286 return r; 287} --- 628 unchanged lines hidden --- |