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

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Mar 29 15:47:17 CEST 2022




Daiki Ueno commented on a discussion on lib/fips.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_893031987

> -static void get_hmac_file(char *mac_file, size_t mac_file_size, const char* orig)
> +/* Parses hmac data and copies hex value into dest.
> + * dest must point to at least HMAC_SIZE amount of memory */
> +static int get_hmac(uint8_t *dest, const char *value)
>  {
> -char* p;
> +	int ret;
> +	size_t hmac_size;
> +	gnutls_datum_t data;
>  
> -	p = strrchr(orig, '/');
> -	if (p==NULL) {
> -		snprintf(mac_file, mac_file_size, ".%s"HMAC_SUFFIX, orig);
> -		return;
> +	data.size = strlen(value);
> +	if (hex_data_size(data.size) != HMAC_SIZE) {

Sorry I somehow missed the `hex_data_size` call.

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


More information about the Gnutls-devel mailing list