/* returns true if the response authenticator is valid input: tvb of the reponse, corresponding request authenticator uses the shared secret to calculate the Response authenticator and checks with the current. see RFC 2865, packet format page 16  */
static gboolean valid_authenticator(tvbuff_t *tvb, guint8 request_authenticator[])
/* returns true if the response authenticator is valid input: tvb of the reponse, corresponding request authenticator uses the shared secret to calculate the Response authenticator and checks with the current. see RFC 2865, packet format page 16  */
static gboolean valid_authenticator(tvbuff_t *tvb, guint8 request_authenticator[])
{
	md5_state_t md_ctx;
	md5_byte_t digest[16];
	guint tvb_length;
	guint8 *payload;
	tvb_length = tvb_captured_length(tvb);
	payload = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length);
	memcpy(payload+4, request_authenticator, AUTHENTICATOR_LENGTH);
	md5_init(&md_ctx);
	md5_append(&md_ctx, payload, tvb_length);
	md5_append(&md_ctx, shared_secret, strlen(shared_secret));
	md5_finish(&md_ctx, digest);
	return !memcmp(digest, authenticator, AUTHENTICATOR_LENGTH);
}