[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:34:07 CEST 2022




Zoltán Fridrich commented on a discussion on lib/fips.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1562#note_893006613

> -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) {

hex in character string is twice as long as hex in binary form.

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


More information about the Gnutls-devel mailing list