summaryrefslogtreecommitdiff
path: root/utility/dumpRSAPublicKey.c
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Enable more warnings for host utilities / testsJulius Werner2019-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a bunch of more warnings that are already enabled in coreboot and thus already enabled for firmware builds anyway (because coreboot just passes its CFLAGS through). Enabling it in the vboot Makefile means they also apply to host utilities and tests, which sounds desirable for consistency. Fix enough of the cruft and bad coding practices that accumulated over the years of not having warnings enabled to get it to build again (this includes making functions static, removing dead code, cleaning up prototypes, etc.). Also remove -fno-strict-aliasing from the x86 firmware build options, because it's not clear why it's there (coreboot isn't doing this, so presumably it's not needed). BRANCH=None BUG=None TEST=make runtests Change-Id: Ie4a42083c4770a4eca133b22725be9ba85b24184 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1598721 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* Update for openssl 1.1Daniel Kurtz2017-07-071-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 1.1 has made significant non-backwards compatible changes to its API as outlined in: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes BRANCH=none BUG=chromium:738114 TEST=cros_workon --host start vboot_reference TEST=w/ openssl-1.0.2k: sudo emerge vboot_reference TEST=w/ openssl-1.1.0e: sudo emerge vboot_reference => both build ok $ futility version => command runs without error TEST=cros_workon --board=soraka start vboot_reference coreboot TEST=w/ openssl-1.0.2k: emerge-soraka vboot_reference coreboot TEST=w/ openssl-1.1.0e: emerge-soraka vboot_reference coreboot => All build ok Change-Id: I37cfc8cbb04a092eab7b0b3224f475b82609447c Reviewed-on: https://chromium-review.googlesource.com/557739 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot_reference: Add support for 3072-bit exponent 3 keysNicolas Boichat2017-03-161-1/+1
| | | | | | | | | | | | | | | | This also adds the required tests (keys, testcases), and some additional tests in vb2_rsa_utility_tests.c that were not added when 2048-bit exponent 3 support was added. BRANCH=none BUG=chromium:684354 TEST=make runtests Change-Id: I56d22302c2254ef500b9d2d290a79d8c8bc39942 Reviewed-on: https://chromium-review.googlesource.com/449060 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: Add support for 2048-bit exponent 3 keysstabilize-9313.Bfirmware-cr50-release-9308.25.Bfirmware-cr50-mp-release-9308.87.Bfirmware-cr50-mp-r86-9311.70.Bfirmware-cr50-mp-9311.Bfirmware-cr50-guc-factory-9308.26.Bfirmware-cr50-9308.Bfirmware-cr50-9308.24.BNicolas Boichat2017-02-181-2/+3
| | | | | | | | | | | | | | This also adds the required tests (keys, testcases). BRANCH=none BUG=chromium:684354 TEST=make runtests Change-Id: I5e148f8792ea325f813d76089271f3c4bcc2935d Reviewed-on: https://chromium-review.googlesource.com/438951 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot: fix name-collision with OpenSSL.stabilize-6946.55.Bstabilize-6937.Brelease-R43-6946.BAdam Langley2015-04-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | vboot currently uses the |SHA256_CTX| name, which is claimed by OpenSSL. To work around this, it defines OPENSSL_NO_SHA, but that can't be done at compile time: The OPENSSL_NO_* defines are set by OpenSSL to reflect the configuration that it was built with so that users of OpenSSL can disable features as needed. They can affect the contents of structures any thus the ABI of the library. If these defines are set outside of OpenSSL, then the library and the code that uses it will have incompatible ABIs. At that point it's only functioning by blind luck. This change renames the name-collisions so that this hack isn't needed. This is the same change as was made internally in cl/85758149. BUG=none BRANCH=none TEST=emerge-samus coreboot; make runtests Change-Id: I709da2507f341896d89d50129ce30ffb111a20d1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/263506 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: Add create command to make keypairs from RSA filesBill Richardson2015-03-101-4/+3
| | | | | | | | | | | | | | | | | | | | This command reads a single .pem file and emits the public and private keys generated from it. It can produce both the old-style vboot 1.0 keys (.vbpubk and .vbprivk), or the new vboot 2.1 format keys (.vbpubk2 and .vbprik2). The default is the new format, but you can give futility the --vb1 arg to force the old format. A test is included. BUG=chromium:231547 BRANCH=ToT TEST=make runtests Change-Id: I4713dc5bf34151052870f88ba52ddccf9d4dab50 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/246766 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Wrap all vboot utilities with futility.firmware-spring-3833.Bfactory-spring-3842.BBill Richardson2013-03-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves all the old userspace utilities generated by vboot_reference into a subdirectory not in $PATH, and replaces them with symlinks to a single executable named 'futility'. At the moment that utility just execs the original utilities (optionally logging that fact first). Ultimately, the old utilities will be subsumed into a single binary instead of multiple separate executables. There is a matching CL needed to make the recovery image creation work. BUG=chromium-os:37062 BRANCH=none CQ-DEPEND=CL:44864 TEST=auto To test, build everything, test everything. It should work as before in all cases. I have built normal images, test images, factory installers, recovery images; they all seem to work. I've run trybots on daisy-paladin link-paladin lumpy-paladin and alex-paladin. Change-Id: Ie93db676f2ed2a64e4b13b3b5dc6b65a77db0f8c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/44871 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* Make dumpRSAPublicKey also accept a public key in PEM formatGaurav Shah2010-11-011-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes dumpRSAPublicKey directly accept a public key in PEM format. This makes it possible to avoid the unnecessary step of generating a self-signed certificate to dump the public key in .keyb format. The old style certificate input is still accepted. Using certs (as done previously): dumpRSAPublicKey -cert <certfile> Directly using public keys: dumpRSAPublicKey -pub <pubfile> Change-Id: Ic35b59aff6613d145d7947212650da281f734b74 BUG=7576 TEST=manual $ openssl genrsa -F4 -out test.pem 4096 $ openssl rsa -in test.pem -out test.pub $ dumpRSAPublicKey -pub test.pub >test.pub.keyb Verify that this matches the output we get using the old style <cert> input. $ openssl req -batch -new -x509 -key test.pem -out test.cert $ dumpRSAPublicKey -cert test.cert >test.cert.keyb $ diff test.pub.keyb test.cert.keyb $ Review URL: http://codereview.chromium.org/4215006
* VBoot Reference: Refactoring Part 3Gaurav Shah2010-03-311-0/+181
Refactor and restructure reference code into individual self-contain modules. I have revamped the way the code is structured to make it easy to determine which parts belong in the firmware and which are used by userland tools. common/ - common utilities and stub functions (Firmware) cryptolib/ - crypto library (Firmware) misclibs/ - miscellaneous userland libraries (Userland) sctips/ - Miscellaenous scripts (Userland) tests/ - Tests (Userland) vfirmware/ - Verified Firmware Implementation vfirmware/firmware_image_fw.c (Firmware) vfirmware/firmware_image.c (Userland) vkernel/ - Verified Kernel Implementation vkernel/kernel_image_fw.c (Firmware) vkernel/kernel_image.c (Userland) Review URL: http://codereview.chromium.org/1581005