[gnutls-devel] PKCS#11 generate random functionality

Nikos Mavrogiannopoulos nmav at gnutls.org
Fri Oct 25 20:10:59 CEST 2013


On 10/25/2013 03:23 PM, Wolfgang Meyer zu Bergsten wrote:
> Hello Nikos,
> thank you for the review!
> 
> On 10/25/2013 02:30 PM, Nikos Mavrogiannopoulos wrote:
>> On 10/25/2013 11:29 AM, Wolfgang Meyer zu Bergsten wrote:
>>> The patch implements a new public function:
>>> int
>>> gnutls_pkcs11_token_get_random (const char *token_url,
>>>                                 size_t len,
>>>                                 gnutls_datum_t *rnddata)
>>
>> Hello Wolfgang,
>>  It looks like a nice addition. However why not follow gnutls_rnd() and
>> just return the random data in a caller-provided buffer rather than an
>> allocated string? I think this would make things simpler. 
> 
> That was actually my first implementation. Then I looked at the other
> PKCS#11 functions, and there the returned data was allocated in gnutls,
> so I thought I should be doing this as well.
> 
> Changed in the appended patch to the proposed interface. New Interface:
> 
> int
> gnutls_pkcs11_token_get_random (const char* token_url,
>                                 void* data,
>                                 size_t len);

Applied. Thank you!





More information about the Gnutls-devel mailing list