[gnutls-devel] GnuTLS | Support for raw public keys for gnutls-cli and gnutls-serv (!1059)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Mon Sep 9 15:14:47 CEST 2019




Tom commented on a discussion on src/cli.c: https://gitlab.com/gnutls/gnutls/merge_requests/1059#note_214185266

>  		}
>  	}
>  
> -	load_keys();
> +	load_x509_keys();

I've looked at that approach and found that splitting into two distinct functions would produce clearer code. The certificate handling code is far more complex than the rawpk code. I could not reuse it, and merging the two would cause more complex branching in the original function (which is already quite long).

Currently the only commonality between `load_x509_keys` and `load_rawpk_keys` is the handling of the private keys. What I could do, given you earlier comment above, is that I extract the shared privkey handling functionality from these functions and create a separate function for that. That way we have two clean functions that serve a clear purpose (i.e. load an x509 key pair and rawpk key pair respectively) without code duplication between them. What do you think?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1059#note_214185266
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/20190909/715809e2/attachment.html>


More information about the Gnutls-devel mailing list