Skip to contentSkip to conversation

KEYS: check the certfile for ASN1 encoding before inserting

PATCH David Howells 1 participant 1 message Mar 19, 2020 Keys/keyrings

lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

Review

Quoted 5 lines · Clay Chang
(quoted diff) +5 -0
+	if (cert[0] != 0x30 && cert[1] != 0x82) {
+		err("Invalid certfile.\n");
+		exit(EXIT_FAILURE);
+	}
+

I wonder if this is a good enough check. It might be better to actually run it through a utility that will actually check the structure (eg. openssl asn1parse or openssl x509) and check the error code.

David