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.

48 lines
1.4 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. --- a/libyara/modules/pe/pe.c
  11. +++ b/libyara/modules/pe/pe.c
  12. @@ -44,8 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
  13. #endif
  14. #if OPENSSL_VERSION_NUMBER < 0x10100000L
  15. -#define X509_getm_notBefore X509_get_notBefore
  16. -#define X509_getm_notAfter X509_get_notAfter
  17. +#define X509_get0_notBefore X509_get_notBefore
  18. +#define X509_get0_notAfter X509_get_notAfter
  19. #endif
  20. #endif
  21. @@ -1433,10 +1433,10 @@ void _parse_pkcs7(
  22. }
  23. }
  24. - date_time = ASN1_get_time_t(X509_get_notBefore(cert));
  25. + date_time = ASN1_get_time_t(X509_get0_notBefore(cert));
  26. set_integer(date_time, pe->object, "signatures[%i].not_before", *counter);
  27. - date_time = ASN1_get_time_t(X509_get_notAfter(cert));
  28. + date_time = ASN1_get_time_t(X509_get0_notAfter(cert));
  29. set_integer(date_time, pe->object, "signatures[%i].not_after", *counter);
  30. (*counter)++;
  31. --- a/libyara/modules/pe/pe_utils.c
  32. +++ b/libyara/modules/pe/pe_utils.c
  33. @@ -307,7 +307,7 @@ time_t timegm(
  34. // and cleaned up. Also uses timegm(3) instead of mktime(3).
  35. time_t ASN1_get_time_t(
  36. - ASN1_TIME* time)
  37. + const ASN1_TIME* time)
  38. {
  39. struct tm t;
  40. const char* str = (const char*) time->data;