2id.h 922 B

1234567891011121314151617181920212223242526272829
  1. /* Copyright 2015 The Chromium OS Authors. All rights reserved.
  2. * Use of this source code is governed by a BSD-style license that can be
  3. * found in the LICENSE file.
  4. *
  5. * Key ID, used to quickly match keys with signatures. There's not a standard
  6. * fingerprint for private keys, so we're using the sha1sum of the public key
  7. * in our keyb format. Pretty much anything would work as long as it's
  8. * resistant to collisions and easy to compare.
  9. */
  10. #ifndef VBOOT_REFERENCE_VBOOT_2ID_H_
  11. #define VBOOT_REFERENCE_VBOOT_2ID_H_
  12. #include <stdint.h>
  13. #define VB2_ID_NUM_BYTES 20
  14. struct vb2_id {
  15. uint8_t raw[VB2_ID_NUM_BYTES];
  16. } __attribute__((packed));
  17. #define EXPECTED_ID_SIZE VB2_ID_NUM_BYTES
  18. /* IDs to use for "keys" with sig_alg==VB2_SIG_NONE */
  19. #define VB2_ID_NONE_SHA1 {{0x00, 0x01,}}
  20. #define VB2_ID_NONE_SHA256 {{0x02, 0x56,}}
  21. #define VB2_ID_NONE_SHA512 {{0x05, 0x12,}}
  22. #endif /* VBOOT_REFERENCE_VBOOT_2ID_H_ */