Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2000 - 2005 Pekka Riikonen
+ Copyright (C) 2000 - 2014 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/* $Id$ */
-#include "silcincludes.h"
+#include "silc.h"
+#include "silcske_i.h"
/* Encodes Key Exchange Start Payload into a SILC Buffer to be sent
to the other end. */
goto err;
}
+ if (payload->len != 4 + payload->cookie_len + payload->version_len +
+ payload->ke_grp_len + payload->pkcs_alg_len + payload->enc_alg_len +
+ payload->hash_alg_len + payload->hmac_alg_len + payload->comp_alg_len +
+ (2 * 7)) {
+ SILC_LOG_ERROR(("Invalid fields in KE Start Payload"));
+ status = SILC_SKE_STATUS_BAD_PAYLOAD;
+ goto err;
+ }
+
/* Return the payload */
*return_payload = payload;