]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Validate DER encoding only if incidence isn't ignored, update gitignore
authorpcarana <pc.moreno2099@gmail.com>
Mon, 11 Nov 2019 21:09:58 +0000 (15:09 -0600)
committerpcarana <pc.moreno2099@gmail.com>
Mon, 11 Nov 2019 21:09:58 +0000 (15:09 -0600)
.gitignore
src/asn1/decode.c

index 4da1a7cf20d93505a4cb144516c7988fd8fb0034..dd5dd6a71ee632966cf54e41b74acf7231434e22 100644 (file)
@@ -101,7 +101,8 @@ docs/_site
 # Files we're sorta contractually obligated to exclude.
 # Can't include ARIN's TAL because of their Relying Party Agreement
 # (https://www.arin.net/resources/manage/rpki/tal/)
-tal/arin.tal
+examples/tal/arin.tal
+examples/tal/arin-rfc7730.tal
 
 # Unwanted manure shat by imbecile OSs
 .DS_Store*
index 6acf4e17b3d1e666924aadcd9faf483a180a42aa..170a1fe1f60829efc34e8e109aeb1067c195bc39 100644 (file)
@@ -4,6 +4,7 @@
 #include "common.h"
 #include "config.h"
 #include "log.h"
+#include "incidence/incidence.h"
 
 #define COND_LOG(log, pr) (log ? pr : -EINVAL)
 
@@ -50,6 +51,10 @@ der_coder(const void *buf, size_t size, void *app_key)
        return 0;
 }
 
+/*
+ * FIXME (next iteration) This isn't efficient, consider implement DER decoding
+ * or something better.
+ */
 static int
 validate_der(size_t ber_consumed, asn_TYPE_descriptor_t const *descriptor,
     const void *original, void *result)
@@ -99,8 +104,9 @@ asn1_decode(const void *buffer, size_t buffer_size,
                        rval.code, rval.consumed));
        }
 
-       /* Validate DER encoding */
-       if (dec_as_der) {
+       /* Validate DER encoding, only if wanted and incidence isn't ignored */
+       if (dec_as_der &&
+           incidence_get_action(INID_OBJ_NOT_DER) != INAC_IGNORE) {
                error = validate_der(rval.consumed, descriptor, buffer,
                    *result);
                if (error) {