gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: buffer\datum questions


From: Olya
Subject: Re: buffer\datum questions
Date: Thu, 02 Aug 2012 11:02:01 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

02.08.2012 06:05, Nikos Mavrogiannopoulos пишет:

> There is _gnutls_bin2hex() that given your buffer's data and length
> fields it would save the hex output in the array you specified.

Do I have to allocate that char * array or _gnutls_bin2hex() will take care of 
that?

>> 5) What does various _prefix() functions do?
> 
> 
> They are used to store the TLS variable length fields. That is they
> prepend the size of the buffer before the data. The prefix size is the
> number of bits used for the length (8,16,24,32).

What's the meaning of check in

_gnutls_buffer_pop_prefix (gnutls_buffer_st * buf, size_t * data_size, int 
check) ?

And few more related questions:

1) Why _gnutls_buffer_replace_data( gnutls_buffer_st * buf, gnutls_datum_t * 
data)
uses datum while _append() uses data & size?

2) Do I have to pre-allocate memory for the datum, copy my data to datum, call
_replace() and deallocate datum? Could you give simple example of _replace() 
usage?

3) When should I use _gnutls_buffer_reset() ?

Thank you for detailed explanations - it's too good to leave it be in my inbox 
:-)
Should I add them to doc/cha-internals.texi or there's more appropriate place 
for that?

best regards,
Olga.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]