You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. --- a/libyara/include/yara/pe_utils.h
  2. +++ b/libyara/include/yara/pe_utils.h
  3. @@ -102,7 +102,7 @@ char *ord_lookup(
  4. #if HAVE_LIBCRYPTO
  5. #include <openssl/asn1.h>
  6. -time_t ASN1_get_time_t(ASN1_TIME* time);
  7. +time_t ASN1_get_time_t(const ASN1_TIME* time);
  8. #endif
  9. #endif
  10. diff --git a/libyara/modules/pe/pe.c b/libyara/modules/pe/pe.c
  11. index 8eace26..ed43abe 100644
  12. --- a/libyara/modules/pe/pe.c
  13. +++ b/libyara/modules/pe/pe.c
  14. @@ -44,8 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15. #endif
  16. #if OPENSSL_VERSION_NUMBER < 0x10100000L
  17. -#define X509_getm_notBefore X509_get_notBefore
  18. -#define X509_getm_notAfter X509_get_notAfter
  19. +#define X509_get0_notBefore X509_get_notBefore
  20. +#define X509_get0_notAfter X509_get_notAfter
  21. #endif
  22. #endif
  23. @@ -1433,10 +1433,10 @@ void _parse_pkcs7(
  24. }
  25. }
  26. - date_time = ASN1_get_time_t(X509_get_notBefore(cert));
  27. + date_time = ASN1_get_time_t(X509_get0_notBefore(cert));
  28. set_integer(date_time, pe->object, "signatures[%i].not_before", *counter);
  29. - date_time = ASN1_get_time_t(X509_get_notAfter(cert));
  30. + date_time = ASN1_get_time_t(X509_get0_notAfter(cert));
  31. set_integer(date_time, pe->object, "signatures[%i].not_after", *counter);
  32. (*counter)++;
  33. --- a/libyara/modules/pe/pe_utils.c
  34. +++ b/libyara/modules/pe/pe_utils.c
  35. @@ -307,7 +307,7 @@ time_t timegm(
  36. // and cleaned up. Also uses timegm(3) instead of mktime(3).
  37. time_t ASN1_get_time_t(
  38. - ASN1_TIME* time)
  39. + const ASN1_TIME* time)
  40. {
  41. struct tm t;
  42. const char* str = (const char*) time->data;