Date: Sat, 28 Jun 2014 11:44:58 GMT From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r270175 - soc2013/def/crashdump-head/sbin/dumpkey Message-ID: <201406281144.s5SBiwkc082866@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: def Date: Sat Jun 28 11:44:58 2014 New Revision: 270175 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=270175 Log: Force to use 4096b RSA keys. Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sat Jun 28 09:53:44 2014 (r270174) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sat Jun 28 11:44:58 2014 (r270175) @@ -62,6 +62,11 @@ if (public_key == NULL) return (-1); + if (RSA_size(public_key) != KERNELDUMP_CIPHERTEXT_SIZE) { + printf("Error: the RSA modulus size has to be equal to %db.\n", + 8 * KERNELDUMP_CIPHERTEXT_SIZE); + return (-1); + } if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE + KERNELDUMP_IV_SIZE, plain_dumpkey, dumpkey->ciphertext, public_key, RSA_PKCS1_PADDING) == -1) { @@ -86,6 +91,11 @@ if (private_key == NULL) return (-1); + if (RSA_size(private_key) != KERNELDUMP_CIPHERTEXT_SIZE) { + printf("Error: the RSA modulus size has to be equal to %db.\n", + 8 * KERNELDUMP_CIPHERTEXT_SIZE); + return (-1); + } if (RSA_private_decrypt(KERNELDUMP_CIPHERTEXT_SIZE, cipherkey, buf, private_key, RSA_PKCS1_PADDING) == -1) { return (-1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406281144.s5SBiwkc082866>