lmco / laikaboss

Laika BOSS: Object Scanning System
Apache License 2.0
732 stars 155 forks source link

meta_x509: avoid bad time values and catch error string exception #51

Open knowmalware opened 7 years ago

knowmalware commented 7 years ago

cert.get_not_before() and cert.get_not_after() can return the string 'Bad time value', which was causing exception when attempting to parse with strptime().

The string.split()'ing on the ugly_error_string was sometimes not producing the number of values expected. If this occurs, the code now calls addFlag("x509:err:unknown").