[gnutls-devel] GnuTLS | support non-NULL-terminated PSKs (!917)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Jun 6 05:24:31 CEST 2019




Nikos Mavrogiannopoulos commented on a discussion on lib/auth/psk.h: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_178417550

>  	/* callback function, instead of reading the
>  	 * password files.
>  	 */
> -	gnutls_psk_server_credentials_function *pwd_callback;
> +	union {
> +		gnutls_psk_server_credentials_function *cb1;

Here you introduce two options for callbacks. What I propose above is to store one callback only (the new), and when the old callback is requested by the application you set as the callback a wrapper which interfaces between them.

See this approach in:
https://gitlab.com/gnutls/gnutls/blob/master/lib/cert-cred.c#L707

There `get_cert_callback3` is the callback supported internally by the library, but when a previous version is requested by the application, a pwrapper function `call_legacy_cert_cb1`](https://gitlab.com/gnutls/gnutls/blob/master/lib/cert-cred.c#L564) is set.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_178417550
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190606/aec2cfeb/attachment.html>


More information about the Gnutls-devel mailing list