{
SilcBuffer buf;
unsigned char *x_str;
- uint32 x_len;
+ SilcUInt32 x_len;
int ret;
SILC_LOG_DEBUG(("Encoding KE Payload"));
SilcSKEStatus status = SILC_SKE_STATUS_ERROR;
SilcSKEKEPayload *payload;
unsigned char *x = NULL;
- uint16 x_len;
- uint32 tot_len = 0, len2;
+ SilcUInt16 x_len;
+ SilcUInt32 tot_len = 0, len2;
int ret;
SILC_LOG_DEBUG(("Decoding Key Exchange Payload"));
goto err;
}
- if (payload->pk_type == 0) {
+ if (ske->start_payload &&
+ (payload->pk_type < SILC_SKE_PK_TYPE_SILC ||
+ payload->pk_type > SILC_SKE_PK_TYPE_SPKI)) {
status = SILC_SKE_STATUS_BAD_PAYLOAD;
goto err;
}
}
if (tot_len != len2) {
- status = SILC_SKE_STATUS_BAD_PAYLOAD;
+ status = SILC_SKE_STATUS_BAD_PAYLOAD_LENGTH;
goto err;
}