Skip to content

Commit 77b5dfa

Browse files
authored
Update authenticode parser (#2034)
This updates authenticode parser to the latest versions which contains sereral fixes which accumulated over time. * Several time_t variables replaced with int64_t * RFC5652 countersignatures are now correctly parsed * Memory corruption related fixes where authenticode-parser would crash otherwise
1 parent 28ac3d2 commit 77b5dfa

File tree

10 files changed

+1471
-1374
lines changed

10 files changed

+1471
-1374
lines changed

libyara/include/authenticode-parser/authenticode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ typedef struct {
106106
char* key_alg; /* Name of the key algorithm */
107107
char* sig_alg; /* Name of the signature algorithm */
108108
char* sig_alg_oid; /* OID of the signature algorithm */
109-
time_t not_before; /* NotBefore validity */
110-
time_t not_after; /* NotAfter validity */
109+
int64_t not_before; /* NotBefore validity */
110+
int64_t not_after; /* NotAfter validity */
111111
char* key; /* PEM encoded public key */
112112
Attributes issuer_attrs; /* Parsed X509 Attributes of Issuer */
113113
Attributes subject_attrs; /* Parsed X509 Attributes of Subject */
@@ -120,7 +120,7 @@ typedef struct {
120120

121121
typedef struct {
122122
int verify_flags; /* COUNTERISGNATURE_VFY_ flag */
123-
time_t sign_time; /* Signing time of the timestamp countersignature */
123+
int64_t sign_time; /* Signing time of the timestamp countersignature */
124124
char* digest_alg; /* Name of the digest algorithm used */
125125
ByteArray digest; /* Stored message digest */
126126
CertificateArray* chain; /* Certificate chain of the signer */
@@ -190,7 +190,7 @@ AuthenticodeArray* parse_authenticode(const uint8_t* pe_data, uint64_t pe_len);
190190
* @param len
191191
* @return AuthenticodeArray*
192192
*/
193-
AuthenticodeArray* authenticode_new(const uint8_t* data, long len);
193+
AuthenticodeArray* authenticode_new(const uint8_t* data, int32_t len);
194194

195195
/**
196196
* @brief Deallocates AuthenticodeArray and all it's allocated members

0 commit comments

Comments
 (0)