futility_options.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2015 The Chromium OS Authors. All rights reserved.
  3. * Use of this source code is governed by a BSD-style license that can be
  4. * found in the LICENSE file.
  5. */
  6. /*
  7. * We centralize option parsing but may split operations into multiple files,
  8. * so let's declare the option structures in a single place (here).
  9. */
  10. #ifndef VBOOT_REFERENCE_FUTILITY_OPTIONS_H_
  11. #define VBOOT_REFERENCE_FUTILITY_OPTIONS_H_
  12. #include <stdint.h>
  13. #include "vboot_common.h"
  14. #include "file_type.h"
  15. #include "2rsa.h"
  16. struct vb2_private_key;
  17. struct vb21_packed_key;
  18. struct show_option_s {
  19. struct vb2_public_key *k;
  20. uint8_t *fv;
  21. uint64_t fv_size;
  22. uint32_t padding;
  23. int strict;
  24. int t_flag;
  25. enum futil_file_type type;
  26. struct vb21_packed_key *pkey;
  27. uint32_t sig_size;
  28. };
  29. extern struct show_option_s show_option;
  30. struct sign_option_s {
  31. struct vb2_private_key *signprivate;
  32. struct vb2_keyblock *keyblock;
  33. struct vb2_packed_key *kernel_subkey;
  34. struct vb2_private_key *devsignprivate;
  35. struct vb2_keyblock *devkeyblock;
  36. uint32_t version;
  37. int version_specified;
  38. uint32_t flags;
  39. int flags_specified;
  40. char *loemdir;
  41. char *loemid;
  42. uint8_t *bootloader_data;
  43. uint64_t bootloader_size;
  44. uint8_t *config_data;
  45. uint32_t config_size;
  46. enum arch_t arch;
  47. int fv_specified;
  48. uint32_t kloadaddr;
  49. uint32_t padding;
  50. int vblockonly;
  51. char *outfile;
  52. int create_new_outfile;
  53. int inout_file_count;
  54. char *pem_signpriv;
  55. int pem_algo_specified;
  56. uint32_t pem_algo;
  57. char *pem_external;
  58. enum futil_file_type type;
  59. enum vb2_hash_algorithm hash_alg;
  60. uint32_t ro_size, rw_size;
  61. uint32_t ro_offset, rw_offset;
  62. uint32_t data_size, sig_size;
  63. struct vb2_private_key *prikey;
  64. };
  65. extern struct sign_option_s sign_option;
  66. /* Return true if hash_alg was identified, either by name or number */
  67. int vb2_lookup_hash_alg(const char *str, enum vb2_hash_algorithm *alg);
  68. #endif /* VBOOT_REFERENCE_FUTILITY_OPTIONS_H_ */