[gnutls-devel] GnuTLS | [WIP] Consolidate FIPS .hmac files (!1562)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Mar 25 19:56:01 CET 2022

Merge request https://gitlab.com/gnutls/gnutls/-/merge_requests/1562 was reviewed by Daiki Ueno

Daiki Ueno started a new discussion on lib/file.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_889491724

> + * Returned pointer needs to be freed.
> + * Returns NULL on error */
> +char *_gnutls_file_basename(const char *file)

Maybe you could rely on the [`basename-lgpl`](https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=modules/basename-lgpl;h=f81898da85e0ecef3018dbd6f0aba5d57ec0703d;hb=HEAD) module from Gnulib?

Daiki Ueno started a new discussion on lib/Makefile.am: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_889491731

> -hmac_files = .libs/.$(gnutls_so).hmac
> +hmac_files = .libs/.hmac

I'd keep the `.$(gnutls_so)` prefix unless the file is installed in a dedicated directory (e.g., `$(pkglibdir)`?).

Daiki Ueno started a new discussion on lib/fips.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_889491736

> +	while ((nread = getline(&line, &alloc, stream)) != -1) {
> +		line[nread - 1] = '\0';
> +		if (!strcmp(line, "[global]")) {

You could use the features from the `lib/inih/ini.h` header if we go with this format (I'd rather think it's a bit too much ;-).

Daiki Ueno started a new discussion on lib/fips.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_889491740

> +		snprintf(mac_file, mac_file_size, ".hmac");
> +	else
> +		snprintf(mac_file, mac_file_size, "%.*s/.hmac", (int)(p - file), file);

We probably need a check on the return value if the path name is too long (e.g., on Nix).

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562
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/20220325/d92ff929/attachment.html>

More information about the Gnutls-devel mailing list