[gnutls-devel] GnuTLS | Handle private keys with lowercase hex digits in DEK-Info (!1655)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Nov 2 06:51:34 CET 2022




Daiki Ueno commented on a discussion on lib/x509/privkey_openssl.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1655#note_1156744450

> -		if (*c >= '0' && *c <= '9')
> -			x = (*c) - '0';
> -		else if (*c >= 'A' && *c <= 'F')
> -			x = (*c) - 'A' + 10;
> -		else {
> -			gnutls_assert();
> -			/* Invalid salt in encrypted PEM file */
> -			ret = GNUTLS_E_INVALID_REQUEST;
> -			goto out_salt;
> -		}
> -		if (i & 1)
> -			salt.data[i / 2] |= x;
> -		else
> -			salt.data[i / 2] = x << 4;
> +	ret = gnutls_hex_decode(&hex_data, salt.data, &salt_size);
> +	if (ret == GNUTLS_E_PARSING_ERROR) {

Good point, fixed.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1655#note_1156744450
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/20221102/63335197/attachment.html>


More information about the Gnutls-devel mailing list