]> git.ipfire.org Git - thirdparty/FORT-validator.git/log
thirdparty/FORT-validator.git
6 years agoRedo RFC 7935
Alberto Leiva Popper [Fri, 22 Mar 2019 01:19:20 +0000 (19:19 -0600)] 
Redo RFC 7935

It's a little faster, and also adds some missing validations.

6 years agoPatch memory leak
Alberto Leiva Popper [Thu, 21 Mar 2019 21:49:04 +0000 (15:49 -0600)] 
Patch memory leak

Probably fixes #5.

6 years agoPatch two memory leaks and bad rsync
Alberto Leiva Popper [Wed, 20 Mar 2019 23:25:31 +0000 (17:25 -0600)] 
Patch two memory leaks and bad rsync

The 'root' download strategy should not apply to the certificate
pointed by the TAL, because we don't trust that URL at that point
yet.

Fixes #4.

6 years agoPatch small bugs found while documenting
Alberto Leiva Popper [Sat, 16 Mar 2019 03:01:53 +0000 (21:01 -0600)] 
Patch small bugs found while documenting

6 years agoPatch infinite loop introduced in the last commit
Alberto Leiva Popper [Fri, 15 Mar 2019 00:28:18 +0000 (18:28 -0600)] 
Patch infinite loop introduced in the last commit

6 years agoHandle ranges properly during IP comparisons
Alberto Leiva Popper [Fri, 15 Mar 2019 00:23:58 +0000 (18:23 -0600)] 
Handle ranges properly during IP comparisons

Hadn't implemented ranges when I implemented comparisons.
Then I forgot to update the code when I added ranges.

Fixes #3.

6 years agoLeave unit tests out of the build by default
Alberto Leiva Popper [Thu, 14 Mar 2019 16:44:08 +0000 (10:44 -0600)] 
Leave unit tests out of the build by default

For two reasons:

- They need the Check framework, which should not be a dependency
  for everyone.
- Check itself is the only dependency managed by pkg-config, so we
  don't want to force everyone to install that either.

No idea if any of this is good practice. But it's much easier to
explain in the documentation, so there you go.

6 years agoUpdate the README
Alberto Leiva Popper [Thu, 14 Mar 2019 04:49:35 +0000 (22:49 -0600)] 
Update the README

6 years agoFix URL shortening during the root strategy
Alberto Leiva Popper [Wed, 13 Mar 2019 00:46:03 +0000 (18:46 -0600)] 
Fix URL shortening during the root strategy

Was completely messing up the RSYNCs.

6 years agoValidate signed object signature
Alberto Leiva Popper [Wed, 13 Mar 2019 00:07:53 +0000 (18:07 -0600)] 
Validate signed object signature

Looks like the chain validation is complete.
It's only missing some profile checks.

6 years agoPrevent integer underflow on sarray_contains()
Alberto Leiva Popper [Mon, 11 Mar 2019 18:35:28 +0000 (12:35 -0600)] 
Prevent integer underflow on sarray_contains()

Was triggering a segfault during testing.

6 years agoRefactor configuration types to their own modules
Alberto Leiva Popper [Thu, 7 Mar 2019 00:13:57 +0000 (18:13 -0600)] 
Refactor configuration types to their own modules

Scales a little better, removes clutter from config.c.

6 years agoImplement thisUpdate, nextUpdate and --roa-output-file
Alberto Leiva Popper [Wed, 6 Mar 2019 21:56:41 +0000 (15:56 -0600)] 
Implement thisUpdate, nextUpdate and --roa-output-file

- Implement manifest thisUpdate and nextUpdate validation
- Print dates during manifest date errors
- ROA file output target is now configurable
  (Used to be dumped into stdout, which was annoying because it was
  mixed with the INFO logging)

6 years agoAdd '--output-file-name-format' option
Alberto Leiva Popper [Tue, 5 Mar 2019 16:51:46 +0000 (10:51 -0600)] 
Add '--output-file-name-format' option

Decides which version of the file name should be printed during
most debug and error messages.

Also found myself starting the manpage.

6 years agoReview on issuer/subject names
Alberto Leiva Popper [Tue, 5 Mar 2019 01:12:02 +0000 (19:12 -0600)] 
Review on issuer/subject names

1. Was ignoring name.serialNumber on some validations
2. Was not erroring on unknown name attributes
3. If the name is not unique, also print the file where the collision
   was found
4. Downgrade uniqueness violation to warning. Otherwise some offending
   certificates are traversed, and others aren't

Number 3 also applied to serial numbers. Patched that as well.

Also, print the full global URI of each file name on error. I don't like
being tied to these awkward long names though; might upload a program
argument to tweak this manually tomorrow.

6 years agoBig fat review of the RSYNC module
Alberto Leiva Popper [Thu, 28 Feb 2019 23:19:48 +0000 (17:19 -0600)] 
Big fat review of the RSYNC module

- The TOML reader now expects correct TOML syntax, according to toml99
- The RSYNC command and its arguments are now configurable
- Instead of an enable-disable RSYNC switch, we now have a
  "synchronization strategy". (Needed to optimize RSYNC operations
  according to user needs.)
- The RSYNC command is now executed via execvp(3) instead of system(3),
  to increase security.

6 years agoEase compilation on OpenBSD
Alberto Leiva Popper [Wed, 27 Feb 2019 17:18:44 +0000 (11:18 -0600)] 
Ease compilation on OpenBSD

Looks like OpenBSD's compiler is about a decade old. GNU11 is not
supported.

Also fix warning on debug disabled.

6 years agoFix comparison between the AKI and SKI extensions
Alberto Leiva Popper [Wed, 27 Feb 2019 16:58:07 +0000 (10:58 -0600)] 
Fix comparison between the AKI and SKI extensions

This happens on self-signed certificates. The code was comparing
the extension data, when the AKI data needed to be further decoded
to validate proper ASN syntax.

6 years agoRemove use of s6_addr32
Alberto Leiva Popper [Tue, 26 Feb 2019 21:48:31 +0000 (15:48 -0600)] 
Remove use of s6_addr32

It wasn't portable.

6 years agoAdding execinfo lib validation in configure.ac file for openBSD compatibility
TheRedTrainer [Tue, 26 Feb 2019 15:34:03 +0000 (09:34 -0600)] 
Adding execinfo lib validation in configure.ac file for openBSD compatibility
Adding sys/socket header reference for openBSD compatibility

6 years agoImplement forgotten requirement from RFC6493
Alberto Leiva Popper [Wed, 20 Feb 2019 20:03:39 +0000 (14:03 -0600)] 
Implement forgotten requirement from RFC6493

"This EE certificate MUST describe its Internet Number Resources
using the "inherit" attribute, rather than explicit description of
a resource set; see [RFC3779]."

6 years agoImplement RFC 6493 (Ghostbusters record)
Alberto Leiva Popper [Wed, 20 Feb 2019 19:12:46 +0000 (13:12 -0600)] 
Implement RFC 6493 (Ghostbusters record)

Issue: I implemented 6493, but not 6350. Only the 6493-defined vCard
requirements are checked.

6 years agoAdd option to color output
Alberto Leiva Popper [Mon, 18 Feb 2019 19:27:16 +0000 (13:27 -0600)] 
Add option to color output

6 years agoConfiguration framework review
Alberto Leiva Popper [Mon, 18 Feb 2019 18:09:49 +0000 (12:09 -0600)] 
Configuration framework review

- Integrate the string data type to the configuration framework properly
  (They are no longer being handled as an exception)
- Integrate the print and free operations to the the framework
  (The rpki_config object is no longer printed and freed manually)
- Add short option support (eg. `-t` instead of `--tal`)
- Add --help, --version and --usage handlers
- Add a bunch of in-code documentation to most configuration fields

6 years agoMerge branch 'args-parser'
Alberto Leiva Popper [Mon, 18 Feb 2019 18:07:27 +0000 (12:07 -0600)] 
Merge branch 'args-parser'

The merge is lazy. Review postponed until next commit.

6 years agoAddress several TODOs.
Alberto Leiva Popper [Thu, 14 Feb 2019 23:03:22 +0000 (17:03 -0600)] 
Address several TODOs.

6 years agoUpdate args parser framework
dhfelix [Thu, 14 Feb 2019 21:57:03 +0000 (15:57 -0600)] 
Update args parser framework

6 years agoUpdate usage of the libcmscodec library
Alberto Leiva Popper [Thu, 14 Feb 2019 16:53:19 +0000 (10:53 -0600)] 
Update usage of the libcmscodec library

6 years agoBugfix: policy was not being initialized
Alberto Leiva Popper [Wed, 13 Feb 2019 23:13:00 +0000 (17:13 -0600)] 
Bugfix: policy was not being initialized

6 years agoAdd a bunch of GCC warning flags
Alberto Leiva Popper [Tue, 12 Feb 2019 21:44:06 +0000 (15:44 -0600)] 
Add a bunch of GCC warning flags

Found lots of bugs because of them. Most are fixed.

6 years agoImplement RFC 8360
Alberto Leiva Popper [Tue, 12 Feb 2019 17:56:16 +0000 (11:56 -0600)] 
Implement RFC 8360

Not really tested, because it doesn't look like there are people using
this feature yet.

Also:
- refactor inet_ntop() usage so we don't have to clutter the stack with
  string buffers every time we want to print.
- Patch sometimes undefined behavior `0xFFFFFFFFu >> 32`.

6 years agoMerge branch 'master' into args-parser
dhfelix [Mon, 11 Feb 2019 22:56:20 +0000 (16:56 -0600)] 
Merge branch 'master' into args-parser

Conflicts:
src/config.c
src/config.h
src/main.c

6 years agoAdd RPKI-specific validation for CRLs
Alberto Leiva Popper [Fri, 8 Feb 2019 19:05:05 +0000 (13:05 -0600)] 
Add RPKI-specific validation for CRLs

6 years agoAdd flag parser framework
dhfelix [Fri, 8 Feb 2019 20:26:52 +0000 (14:26 -0600)] 
Add flag parser framework

- checkpoint commit
- First version, stable and working but needs some tweaks

6 years agoCode review
Alberto Leiva Popper [Thu, 7 Feb 2019 21:47:42 +0000 (15:47 -0600)] 
Code review

- Print relevant IP address on address errors
- Add missing resource validations (swapped ranges, AS number out of
  bounds)
- Remove validation of ROA's AS number. The RFCs never state that the
  number must be present in the EE certificate.

6 years agoRemove unnecessary conversion
pcarana [Thu, 7 Feb 2019 17:41:06 +0000 (11:41 -0600)] 
Remove unnecessary conversion

6 years agoKeep validating certs, don't stop on a child cert error
pcarana [Thu, 7 Feb 2019 16:57:06 +0000 (10:57 -0600)] 
Keep validating certs, don't stop on a child cert error

6 years agoImplement cert's subject validation
pcarana [Wed, 6 Feb 2019 22:54:41 +0000 (16:54 -0600)] 
Implement cert's subject validation

6 years agoMerge branch 'intstructs' of https://github.com/ydahhrk/rpki-validator into intstructs
pcarana [Tue, 5 Feb 2019 21:15:55 +0000 (15:15 -0600)] 
Merge branch 'intstructs' of https://github.com/ydahhrk/rpki-validator into intstructs

6 years agoValidate certificate policies extension
pcarana [Tue, 5 Feb 2019 18:27:22 +0000 (12:27 -0600)] 
Validate certificate policies extension

6 years agoValidate manifest number size
pcarana [Tue, 5 Feb 2019 18:17:30 +0000 (12:17 -0600)] 
Validate manifest number size

6 years agoCast INTEGER_t as unsigned long and use as such
pcarana [Fri, 1 Feb 2019 23:17:19 +0000 (17:17 -0600)] 
Cast INTEGER_t as unsigned long and use as such

6 years agoAdapt types from long to INTEGER_t
pcarana [Fri, 1 Feb 2019 01:30:44 +0000 (19:30 -0600)] 
Adapt types from long to INTEGER_t

6 years agoValidate certificate policies extension
pcarana [Tue, 5 Feb 2019 18:27:22 +0000 (12:27 -0600)] 
Validate certificate policies extension

6 years agoValidate manifest number size
pcarana [Tue, 5 Feb 2019 18:17:30 +0000 (12:17 -0600)] 
Validate manifest number size

6 years agoImpose a certificate chain length limit by configuration
Alberto Leiva Popper [Sat, 2 Feb 2019 00:08:51 +0000 (18:08 -0600)] 
Impose a certificate chain length limit by configuration

Also add a configuration module, and patch a ROA address iteration
bug.

6 years agoCast INTEGER_t as unsigned long and use as such
pcarana [Fri, 1 Feb 2019 23:17:19 +0000 (17:17 -0600)] 
Cast INTEGER_t as unsigned long and use as such

6 years agoAdd parsing for a config file
dhfelix [Fri, 1 Feb 2019 22:30:09 +0000 (16:30 -0600)] 
Add parsing for a config file

First version of it, needs more tweaks, but first I need
to finish an arg parser framework.

6 years agoCertificate serial number uniqueness validation
Alberto Leiva Popper [Fri, 1 Feb 2019 19:16:06 +0000 (13:16 -0600)] 
Certificate serial number uniqueness validation

6 years agoAdapt types from long to INTEGER_t
pcarana [Fri, 1 Feb 2019 01:30:44 +0000 (19:30 -0600)] 
Adapt types from long to INTEGER_t

6 years agoMerge branch 'ydahhrk'
Alberto Leiva Popper [Wed, 30 Jan 2019 16:50:54 +0000 (10:50 -0600)] 
Merge branch 'ydahhrk'

6 years agoUnify Access Description management
Alberto Leiva Popper [Wed, 30 Jan 2019 16:45:16 +0000 (10:45 -0600)] 
Unify Access Description management

6 years agoStrengthen the TAL parser
Alberto Leiva Popper [Tue, 29 Jan 2019 22:16:28 +0000 (16:16 -0600)] 
Strengthen the TAL parser

Prevents segfaults when there's no blank line between the URI
section and the public key, as well as when the file is empty.

Fixes #1.

6 years agoAdd validation of IP vs Range selection
Alberto Leiva Popper [Tue, 29 Jan 2019 20:36:09 +0000 (14:36 -0600)] 
Add validation of IP vs Range selection

RFC 3779, section 2.2.3.7.
Also patch memory leaks during AIA handling and other small TODOs.

6 years agoAdd getopt to handle argc and argv
dhfelix [Sat, 26 Jan 2019 03:09:13 +0000 (21:09 -0600)] 
Add getopt to handle argc and argv

- Needs more tweaks

6 years agoMerge branch 'ydahhrk'
Alberto Leiva Popper [Fri, 25 Jan 2019 22:39:18 +0000 (16:39 -0600)] 
Merge branch 'ydahhrk'

6 years agoPostpone recursive traversal and validate Access Descriptions
Alberto Leiva Popper [Fri, 25 Jan 2019 22:28:16 +0000 (16:28 -0600)] 
Postpone recursive traversal and validate Access Descriptions

1. It was traversing through children before the current
   certificate's validation was done. It's fixed now.
2. Adds validation of CRL Distribution Points, AIA.caIssuers and
   SIA.signedObject.
   Man, those requirements looked deceively small. It was a
   freaking mess.
   I'm not actually sure this is the final version of this code,
   because several argument lists grew too much for my liking.

6 years agoReview of rsync.c code
dhfelix [Wed, 23 Jan 2019 18:04:28 +0000 (12:04 -0600)] 
Review of rsync.c code

6 years agoEngineer URIs a little
Alberto Leiva Popper [Tue, 22 Jan 2019 22:57:11 +0000 (16:57 -0600)] 
Engineer URIs a little

Should make URIs easier to use, and prevent the missing
null character bug from appearing again.

6 years agoMerge branch 'master' of github.com:ydahhrk/rpki-validator
Alberto Leiva Popper [Fri, 18 Jan 2019 20:28:40 +0000 (14:28 -0600)] 
Merge branch 'master' of github.com:ydahhrk/rpki-validator

6 years agoMore misc tweaks:
Alberto Leiva Popper [Fri, 18 Jan 2019 20:09:12 +0000 (14:09 -0600)] 
More misc tweaks:

- Validate more certificate extensions
- Ensure there is only one visible CRL and manifest per publication
  point.
- Validate ROA's max length more thoroughly.

6 years agoImprove of rsync.c code
dhfelix [Fri, 18 Jan 2019 18:46:42 +0000 (12:46 -0600)] 
Improve of rsync.c code

-add unit test for rsync.c
-TODO fix tal_tests

6 years agoImplement some postponed requirements
Alberto Leiva Popper [Tue, 15 Jan 2019 15:42:17 +0000 (09:42 -0600)] 
Implement some postponed requirements

At this point I'm filling in blanks and TODOs rather than focus on a
particular feature. Mainly, this commit adds

- Validate certificate extensions
- Improve the main loop so it stops on the TAL's first successful URI

6 years agoReview of rsync.c code
Alberto Leiva Popper [Fri, 21 Dec 2018 06:04:47 +0000 (00:04 -0600)] 
Review of rsync.c code

Still need to review the calling code and actually test it.

6 years agoMerge branch 'rsync'
Alberto Leiva Popper [Thu, 20 Dec 2018 19:10:20 +0000 (13:10 -0600)] 
Merge branch 'rsync'

6 years agoValidate signed object hashes
Alberto Leiva Popper [Thu, 20 Dec 2018 17:09:17 +0000 (11:09 -0600)] 
Validate signed object hashes

And address several other minor TODOs

6 years agoAdd validation of manifest hashes
Alberto Leiva Popper [Mon, 17 Dec 2018 23:26:42 +0000 (17:26 -0600)] 
Add validation of manifest hashes

It seems that the basic tree validation, at least as far as the
first iteration is concerned, is done.

Except I never managed to understand AS validation at all. It's
like there's nothing to do.

Of course, there's still a ways to go. I still have to add many
little ifs that the project needs to reach strict RFC compliance.
Also those 20-octet sequence manifest numbers. WTF.

6 years agoAdds:
Alberto Leiva Popper [Mon, 17 Dec 2018 19:01:35 +0000 (13:01 -0600)] 
Adds:

- Check that the TAL's public key matches the root cert's public key
- Validate EE certificates differently than CA certificates
- Reorder tree traversal. (I noticed that I was doing it wrong.)
- Polish many other validations by hunting TODOs

6 years agoAdd rsync command execution to download repositories
dhfelix [Fri, 14 Dec 2018 22:48:40 +0000 (16:48 -0600)] 
Add rsync command execution to download repositories

First version of the code, when executing the app, if a 4th arg is
detected, the app will not run rsync.

Maybe I need to replace the "system()" call with another function to
execute the "rsync command"

Also needs to read the "rsync command" from a user JSON configuration
file.

6 years agoRefactor: Send the validation state to thread local
Alberto Leiva Popper [Tue, 11 Dec 2018 17:18:31 +0000 (11:18 -0600)] 
Refactor: Send the validation state to thread local

Unclutters lots of argument lists.
Also delete the prefix*_contains functions. Weren't being used.

6 years agoAutomatically print offending files' names on errors
Alberto Leiva Popper [Tue, 11 Dec 2018 15:12:20 +0000 (09:12 -0600)] 
Automatically print offending files' names on errors

6 years agoAdds:
Alberto Leiva Popper [Sat, 8 Dec 2018 03:26:15 +0000 (21:26 -0600)] 
Adds:

- IP ranges
- Bunch of ROA validation
- Bunch of certificate validation

I clearly don't understand how EE certificates validate AS numbers.
They never seem to have the AS extension.
Back to reading...

6 years agoMore certificate validation
Alberto Leiva Popper [Thu, 29 Nov 2018 21:52:13 +0000 (15:52 -0600)] 
More certificate validation

Includes an implementation of RFC 3779.

There's a lot of diff pollution due to another log.c refactor.
I can't seem to nail the right implementation of that thing.

6 years agoAdd actual certificate tree validation and other misc tweaks
Alberto Leiva Popper [Thu, 15 Nov 2018 20:11:47 +0000 (14:11 -0600)] 
Add actual certificate tree validation and other misc tweaks

The tweaks are

1. Unified error message printing. Probably not the final version.
2. Add validation state object, meant to be passed around everywhere.
   Prevents global variables.
3. Add a sketch of the CRL code. WIP.

6 years agoImplement address block parsing (rfc3779, section 2.1)
Alberto Leiva Popper [Wed, 7 Nov 2018 16:14:20 +0000 (10:14 -0600)] 
Implement address block parsing (rfc3779, section 2.1)

Also, move the signed code decoding to its own module to prevent
duplicate code elsewhere

6 years agoImplement a bunch of global logic
Alberto Leiva Popper [Fri, 2 Nov 2018 19:18:05 +0000 (13:18 -0600)] 
Implement a bunch of global logic

The code traverses my repository clone, apparently in a correct
(although recursive) manner.

Not many validations are performed yet.

7 years agoImplement about 40% of RFC 6486 (Manifests)
Alberto Leiva Popper [Thu, 27 Sep 2018 21:56:50 +0000 (16:56 -0500)] 
Implement about 40% of RFC 6486 (Manifests)

7 years agoImplement about 80% of RFC 6482 (ROAs)
Alberto Leiva Popper [Wed, 26 Sep 2018 18:49:45 +0000 (13:49 -0500)] 
Implement about 80% of RFC 6482 (ROAs)

7 years agoAbout 80% of RFC 6488
Alberto Leiva Popper [Fri, 21 Sep 2018 22:42:58 +0000 (17:42 -0500)] 
About 80% of RFC 6488

7 years agoImplement RFC 7730 (TALs)
Alberto Leiva Popper [Tue, 4 Sep 2018 21:17:34 +0000 (16:17 -0500)] 
Implement RFC 7730 (TALs)

7 years agoInitial commit
Alberto Leiva Popper [Tue, 4 Sep 2018 21:08:55 +0000 (16:08 -0500)] 
Initial commit