From owner-svn-soc-all@FreeBSD.ORG Sat Jun 28 11:44:59 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 547238B2 for ; Sat, 28 Jun 2014 11:44:59 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40CDB2012 for ; Sat, 28 Jun 2014 11:44:59 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SBixaC082886 for ; Sat, 28 Jun 2014 11:44:59 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s5SBiwkc082866 for svn-soc-all@FreeBSD.org; Sat, 28 Jun 2014 11:44:58 GMT (envelope-from def@FreeBSD.org) Date: Sat, 28 Jun 2014 11:44:58 GMT Message-Id: <201406281144.s5SBiwkc082866@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r270175 - soc2013/def/crashdump-head/sbin/dumpkey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2014 11:44:59 -0000 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);