git: DragonFly_RELEASE_6_4 opencrypto: Update aes_ctr_setkey() to validate key bits to avoid panic

Aaron LI aly at crater.dragonflybsd.org
Fri Nov 17 18:18:13 PST 2023


commit 02793a4afc03607c685abfc69cc73f22a999abba
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Nov 18 10:17:53 2023 +0800

    opencrypto: Update aes_ctr_setkey() to validate key bits to avoid panic
    
    AES rijndaelKeySetupEnc() only accepts key of length 128/192/256 bits
    and it uses a KASSERT() to assert this.  However, aes_ctr_setkey() can
    be given an improper key via ioctl() and thus panic the system.  Fix
    this panic by validating the key in aes_ctr_setkey() before calling
    rijndaelKeySetupEnc().
    
    This partially resolves bug #3311.
    
    Bug: https://bugs.dragonflybsd.org/issues/3311

Summary of changes:
 sys/opencrypto/xform.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/02793a4afc03607c685abfc69cc73f22a999abba


-- 
DragonFly BSD source repository


More information about the Commits mailing list