Date: Tue, 1 Dec 2015 23:09:25 GMT From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r294726 - soc2013/def/crashdump-head/sbin/dumpon Message-ID: <201512012309.tB1N9PYF078569@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: def Date: Tue Dec 1 23:09:25 2015 New Revision: 294726 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=294726 Log: Verify if a public key is no longer than 16384b. Modified: soc2013/def/crashdump-head/sbin/dumpon/dumpon.c Modified: soc2013/def/crashdump-head/sbin/dumpon/dumpon.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpon/dumpon.c Tue Dec 1 22:50:32 2015 (r294725) +++ soc2013/def/crashdump-head/sbin/dumpon/dumpon.c Tue Dec 1 23:09:25 2015 (r294726) @@ -132,6 +132,11 @@ errx(1, "Unable to read data from %s.", pubkeyfile); kda->kda_encryptedkeysize = RSA_size(pubkey); + if (kda->kda_encryptedkeysize > KERNELDUMP_ENCKEY_MAX_SIZE) { + errx(1, "Public key has to be at most %db long.", + 8 * KERNELDUMP_ENCKEY_MAX_SIZE); + } + kda->kda_encryptedkey = calloc(1, kda->kda_encryptedkeysize); if (kda->kda_encryptedkey == NULL) err(1, "Unable to allocate encrypted key");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512012309.tB1N9PYF078569>