0003-Avoid-RSA-type-redefinition.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 593407d2b3ea3b871d55ec399671e48c84b900a7 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Thu, 21 Jan 2016 22:01:37 +0100
  4. Subject: [PATCH] Avoid RSA type redefinition
  5. The host_key.h headers does:
  6. typedef struct rsa_st RSA;
  7. But this type definition is already done by the OpenSSL headers.
  8. While such a type redefinition is legal with recent gcc versions, it
  9. doesn't build with older gcc versions such as gcc 4.4.
  10. To work around this problem, we instead use a forward declaration of
  11. "struct rsa_st", and change the only place where the RSA type was used
  12. by "struct rsa_st".
  13. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. ---
  15. host/lib/include/host_key.h | 4 ++--
  16. 1 file changed, 2 insertions(+), 2 deletions(-)
  17. diff --git a/host/lib/include/host_key.h b/host/lib/include/host_key.h
  18. index 9f98ccc..c2d01a5 100644
  19. --- a/host/lib/include/host_key.h
  20. +++ b/host/lib/include/host_key.h
  21. @@ -12,11 +12,11 @@
  22. #include "vboot_struct.h"
  23. -typedef struct rsa_st RSA;
  24. +struct rsa_st;
  25. /* Private key data */
  26. typedef struct VbPrivateKey {
  27. - RSA* rsa_private_key; /* Private key data */
  28. + struct rsa_rt* rsa_private_key; /* Private key data */
  29. uint64_t algorithm; /* Algorithm to use when signing */
  30. } VbPrivateKey;
  31. --
  32. 2.6.4