[gnutls-devel] Guile-GnuTLS | Add gnutls_x509_privkey_export binding. (5fb0e70b)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Jun 16 17:51:28 CEST 2023




civodul started a new discussion on guile/src/core.c: https://gitlab.com/gnutls/guile/-/commit/5fb0e70b3bea2a9256c7c803c59c6423c8ad298e#note_1434312179

> +	    "Return a bytevector resulting from the export of @var{key} "
> +	    "(an X.509 private key) according to @var{format}.")
> +#define FUNC_NAME s_scm_gnutls_export_x509_private_key
> +{
> +  int err;
> +  SCM result;
> +  gnutls_x509_privkey_t c_key;
> +  gnutls_x509_crt_fmt_t c_format;
> +  uint8_t *c_data;
> +  size_t c_data_len;
> +
> +  c_key = scm_to_gnutls_x509_private_key (key, 1, FUNC_NAME);
> +  c_format = scm_to_gnutls_x509_certificate_format (format, 2, FUNC_NAME);
> +  c_data = scm_malloc (2048);
> +  c_data_len = sizeof (c_data);
> +

Perhaps there's some factorization that can be done between `crt_export` and `privey_export`, similar to `pkcs_export_parameters`?

Also, perhaps we can allocate directly a bytevector instead of using `scm_malloc` + `memcpy` + `free`.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/guile/-/commit/5fb0e70b3bea2a9256c7c803c59c6423c8ad298e#note_1434312179
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/20230616/ec529506/attachment-0001.html>


More information about the Gnutls-devel mailing list