gnutls_session_pack.c   gnutls_session_pack.c 
skipping to change at line 612 skipping to change at line 612
BUFFER_APPEND_NUM(ps, info->dh.secret_bits); BUFFER_APPEND_NUM(ps, info->dh.secret_bits);
BUFFER_APPEND_PFX4(ps, info->dh.prime.data, info->dh.prime.size); BUFFER_APPEND_PFX4(ps, info->dh.prime.data, info->dh.prime.size);
BUFFER_APPEND_PFX4(ps, info->dh.generator.data, BUFFER_APPEND_PFX4(ps, info->dh.generator.data,
info->dh.generator.size); info->dh.generator.size);
BUFFER_APPEND_PFX4(ps, info->dh.public_key.data, BUFFER_APPEND_PFX4(ps, info->dh.public_key.data,
info->dh.public_key.size); info->dh.public_key.size);
/* write the real size */ /* write the real size */
_gnutls_write_uint32(ps->length - cur_size, _gnutls_write_uint32(ps->length - cur_size,
ps->data + size_offset); ps->data + size_offset);
return 0; return 0;
} }
static int static int
unpack_psk_auth_info(gnutls_session_t session, gnutls_buffer_st * ps) unpack_psk_auth_info(gnutls_session_t session, gnutls_buffer_st * ps)
{ {
size_t username_size, hint_size; size_t username_size, hint_size;
int ret; int ret;
psk_auth_info_t info; psk_auth_info_t info;
unsigned pack_size;
ret = ret =
_gnutls_auth_info_set(session, GNUTLS_CRD_PSK, _gnutls_auth_info_set(session, GNUTLS_CRD_PSK,
sizeof(psk_auth_info_st), 1); sizeof(psk_auth_info_st), 1);
if (ret < 0) { if (ret < 0) {
gnutls_assert(); gnutls_assert();
return ret; return ret;
} }
info = _gnutls_get_auth_info(session, GNUTLS_CRD_PSK); info = _gnutls_get_auth_info(session, GNUTLS_CRD_PSK);
if (info == NULL) if (info == NULL)
return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR); return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
BUFFER_POP_NUM(ps, pack_size);
if (pack_size == 0)
return GNUTLS_E_INVALID_REQUEST;
BUFFER_POP_NUM(ps, username_size); BUFFER_POP_NUM(ps, username_size);
if (username_size > sizeof(info->username)) { if (username_size > sizeof(info->username)) {
gnutls_assert(); gnutls_assert();
return GNUTLS_E_INTERNAL_ERROR; return GNUTLS_E_INTERNAL_ERROR;
} }
BUFFER_POP(ps, info->username, username_size); BUFFER_POP(ps, info->username, username_size);
BUFFER_POP_NUM(ps, hint_size); BUFFER_POP_NUM(ps, hint_size);
if (hint_size > sizeof(info->hint)) { if (hint_size > sizeof(info->hint)) {
 End of changes. 3 change blocks. 
1 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/