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;
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to