[gnutls-devel] GnuTLS | Add Linux kernel AF_ALG backend (!1404)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Thu Apr 15 09:55:48 CEST 2021



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

--
  
Daiki Ueno started a new discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404#note_552233163

> +	struct kcapi_handle *handle;
> +	int encdec : 1;	// 0-enc 1-dec
> +	uint8_t iv[0];

nit: afaik zero-length arrays are not super portable; can we just use `MAX_CIPHER_IV_SIZE`, and return error if the kernel returns larger IV size?

--
  
Daiki Ueno started a new discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404#note_552233166

> +	struct kcapi_handle *handle;
> +	int taglen_set : 1;
> +	int ccm : 1;

nit: let's not use bit fields; we are not so memory-stingy.

--
  
Daiki Ueno started a new discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404#note_552233171

> +	switch(algorithm){
> +		case GNUTLS_CIPHER_AES_128_CCM:
> +		FALLTHROUGH;

I don't think you need this `FALLTHROUGH` line, as there are no statements between two `case`s.

--
  
Daiki Ueno started a new discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404#note_552233178

> +
> +	memcpy(ctx->iv, iv, iv_size);
> +	if(ctx->encdec){

nit: put a space between `if` and `(`, also `)` and `}`:
https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces

--
  
Daiki Ueno started a new discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404#note_552233183

> +	iov[0].iov_len = auth_size;
> +	uint32_t outbuflen = kcapi_aead_outbuflen_dec(ctx->handle,
> +										 encr_size - tag_size,

nit: indent


-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1404
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/20210415/522896db/attachment-0001.html>


More information about the Gnutls-devel mailing list