[gnutls-devel] Guile-GnuTLS | Add gnutls_x509_privkey_export binding. (db23ac18)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Fri Jun 16 17:43:38 CEST 2023
civodul started a new discussion on guile/src/core.c: https://gitlab.com/gnutls/guile/-/commit/db23ac1829cd887be57e1409cddd76a612bbb4cc#note_1434301822
> + "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/db23ac1829cd887be57e1409cddd76a612bbb4cc#note_1434301822
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/f1afcc51/attachment-0001.html>
More information about the Gnutls-devel
mailing list