Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2020 17:09:21 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r359524 - head/sys/kgssapi/krb5
Message-ID:  <202004011709.031H9LjL041911@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Apr  1 17:09:21 2020
New Revision: 359524
URL: https://svnweb.freebsd.org/changeset/base/359524

Log:
  Set crp_ilen for crypto requests.
  
  Assertions in crypto_dispatch() depend on this value being set to
  verify that payload and AAD regions are in bounds.  Also, requests
  that use a single kernel buffer rely on this to know how long the
  buffer is for bus_dma, etc.
  
  Reported by:	kp

Modified:
  head/sys/kgssapi/krb5/kcrypto_aes.c

Modified: head/sys/kgssapi/krb5/kcrypto_aes.c
==============================================================================
--- head/sys/kgssapi/krb5/kcrypto_aes.c	Wed Apr  1 17:08:55 2020	(r359523)
+++ head/sys/kgssapi/krb5/kcrypto_aes.c	Wed Apr  1 17:09:21 2020	(r359524)
@@ -158,6 +158,7 @@ aes_encrypt_1(const struct krb5_key_state *ks, int buf
 
 	crp->crp_buf_type = buftype;
 	crp->crp_buf = buf;
+	crp->crp_ilen = skip + len;
 	crp->crp_opaque = as;
 	crp->crp_callback = aes_crypto_cb;
 
@@ -329,6 +330,7 @@ aes_checksum(const struct krb5_key_state *ks, int usag
 	crp->crp_flags = CRYPTO_F_CBIFSYNC;
 	crp->crp_buf_type = CRYPTO_BUF_MBUF;
 	crp->crp_mbuf = inout;
+	crp->crp_ilen = skip + inlen + 12;
 	crp->crp_opaque = as;
 	crp->crp_callback = aes_crypto_cb;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004011709.031H9LjL041911>