[gnutls-devel] GnuTLS | WIP: gnutls_hkdf{expand, extract}: new API functions exposed (!1115)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Nov 8 16:32:46 CET 2019




Daiki Ueno started a new discussion on lib/crypto-api.c: https://gitlab.com/gnutls/gnutls/merge_requests/1115#note_242092362

> +		hkdf_expand(&ctx, (nettle_hash_update_func*)hmac_sha256_update,
> +		(nettle_hash_digest_func*)hmac_sha256_digest, SHA256_DIGEST_SIZE,
> +		info_size, info, out_size, out);
> +		break;
> +	}
> +	case GNUTLS_MAC_SHA384:{
> +		struct hmac_sha384_ctx ctx;
> +
> +		hmac_sha384_set_key(&ctx, SHA384_DIGEST_SIZE, secret);
> +		hkdf_expand(&ctx, (nettle_hash_update_func*)hmac_sha384_update,
> +			(nettle_hash_digest_func*)hmac_sha384_digest, SHA384_DIGEST_SIZE,
> +			info_size, info, out_size, out);
> +		break;
> +	}
> +	default:
> +		return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);

Since this is a public API, better not return an "internal error". `GNUTLS_E_INVALID_REQUEST` would be more appropriate.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1115#note_242092362
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/20191108/c05b36e3/attachment.html>


More information about the Gnutls-devel mailing list