socsvn commit: r270175 - soc2013/def/crashdump-head/sbin/dumpkey

def at FreeBSD.org def at FreeBSD.org
Sat Jun 28 11:44:59 UTC 2014


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);


More information about the svn-soc-all mailing list