]> git.ipfire.org Git - thirdparty/FORT-validator.git/log
thirdparty/FORT-validator.git
7 years agoCalculate and get changes between serials.
pcarana [Fri, 15 Mar 2019 15:41:08 +0000 (09:41 -0600)] 
Calculate and get changes between serials.

Use a base serial, the base will always be the last DB update.
Calculate the difference between the latest version and the past, and store it as delta.
Save pointers to deltas, increment last serial number when the update ops are complete.
Avoid to send duplicate announcements/withdrawals.

7 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

7 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.

7 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.

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

7 years agoSimplify some code
pcarana [Wed, 13 Mar 2019 18:57:45 +0000 (12:57 -0600)] 
Simplify some code

7 years agoShow error code when an error report PDU is received/sent
pcarana [Wed, 13 Mar 2019 18:16:01 +0000 (12:16 -0600)] 
Show error code when an error report PDU is received/sent

7 years agoRename some getters (current session ID and last serial number)
pcarana [Wed, 13 Mar 2019 17:51:41 +0000 (11:51 -0600)] 
Rename some getters (current session ID and last serial number)

7 years agoSupport only RTR v0 (for now)
pcarana [Wed, 13 Mar 2019 17:45:27 +0000 (11:45 -0600)] 
Support only RTR v0 (for now)

7 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.

7 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.

7 years agoRemove segfault
pcarana [Mon, 11 Mar 2019 19:12:13 +0000 (13:12 -0600)] 
Remove segfault

7 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.

7 years agoUse Error PDUs handling methods and prepare to send other error PDUs
pcarana [Mon, 11 Mar 2019 17:52:36 +0000 (11:52 -0600)] 
Use Error PDUs handling methods and prepare to send other error PDUs

Send Unexpected Protocol Version when needed.
Simplify 'send_error_report_pdu' call.
Remove error codes definitions from 'pdu.h'.
Send Unsupported PDU error when such PDUs arrive to the server.
Try to close socket when a fatal Error PDU is received.
Log errno when there's an error sending a response.

7 years agoCreate custom handling methods for Error PDUs
pcarana [Mon, 11 Mar 2019 17:38:23 +0000 (11:38 -0600)] 
Create custom handling methods for Error PDUs

7 years agoSend only header of erroneous PDU at Error Report PDU
pcarana [Fri, 8 Mar 2019 16:25:11 +0000 (10:25 -0600)] 
Send only header of erroneous PDU at Error Report PDU

7 years agoSet VRPs check interval min value to 60 secs
pcarana [Fri, 8 Mar 2019 15:32:54 +0000 (09:32 -0600)] 
Set VRPs check interval min value to 60 secs

7 years agoRemove unused ttl, the client is related to the socket file descriptor
pcarana [Fri, 8 Mar 2019 15:28:57 +0000 (09:28 -0600)] 
Remove unused ttl, the client is related to the socket file descriptor

7 years agoNotify clients when CSV data is updated
pcarana [Thu, 7 Mar 2019 23:24:57 +0000 (17:24 -0600)] 
Notify clients when CSV data is updated

7 years agoAdd file descriptor to client, and create function to fetch all clients
pcarana [Thu, 7 Mar 2019 23:20:35 +0000 (17:20 -0600)] 
Add file descriptor to client, and create function to fetch all clients

7 years agoReplace unnecessary header
pcarana [Thu, 7 Mar 2019 18:26:52 +0000 (12:26 -0600)] 
Replace unnecessary header

7 years agoRemember connected clients
pcarana [Thu, 7 Mar 2019 01:03:45 +0000 (19:03 -0600)] 
Remember connected clients

Use sockaddr_storage to fetch both IPv4 & 6 socket info.
Fetch the RTR version when the PDU is loaded.
Expose client data for later use (Serial Notify PDU).

7 years agoUse NULL instead of start_serial (is the same thing)
pcarana [Thu, 7 Mar 2019 00:54:41 +0000 (18:54 -0600)] 
Use NULL instead of start_serial (is the same thing)

7 years agoCreate 'state' struct to store instance values/db
pcarana [Thu, 7 Mar 2019 00:52:46 +0000 (18:52 -0600)] 
Create 'state' struct to store instance values/db

7 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.

7 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)

7 years agoForce cache reset on db update, use millisecs at last update of db file
pcarana [Tue, 5 Mar 2019 21:31:22 +0000 (15:31 -0600)] 
Force cache reset on db update, use millisecs at last update of db file

7 years agoSend correct 'last serial number', remove uninitialized var warning
pcarana [Tue, 5 Mar 2019 21:28:27 +0000 (15:28 -0600)] 
Send correct 'last serial number', remove uninitialized var warning

7 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.

7 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.

7 years agoCreate daemon and conf to look for VRPs file updates
pcarana [Tue, 5 Mar 2019 00:33:24 +0000 (18:33 -0600)] 
Create daemon and conf to look for VRPs file updates

7 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.

7 years agoSimplify some code
pcarana [Thu, 28 Feb 2019 21:56:02 +0000 (15:56 -0600)] 
Simplify some code

7 years agoImplement Serial Notify PDU (isn't sent yet)
pcarana [Thu, 28 Feb 2019 21:30:55 +0000 (15:30 -0600)] 
Implement Serial Notify PDU (isn't sent yet)

7 years agoAdd session ID per protocol version
pcarana [Thu, 28 Feb 2019 21:06:57 +0000 (15:06 -0600)] 
Add session ID per protocol version

7 years agoUse timestamp as session ID
pcarana [Thu, 28 Feb 2019 19:55:08 +0000 (13:55 -0600)] 
Use timestamp as session ID

7 years agoAdd intervals validation
pcarana [Thu, 28 Feb 2019 15:34:59 +0000 (09:34 -0600)] 
Add intervals validation

7 years agoAvoid possible buffer overflow
pcarana [Thu, 28 Feb 2019 14:42:40 +0000 (08:42 -0600)] 
Avoid possible buffer overflow

7 years agoImplement error report PDU and send when no data is available
pcarana [Thu, 28 Feb 2019 14:33:33 +0000 (08:33 -0600)] 
Implement error report PDU and send when no data is available

7 years agoRelease allocated line-copy
pcarana [Wed, 27 Feb 2019 22:23:04 +0000 (16:23 -0600)] 
Release allocated line-copy

7 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.

7 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.

7 years agoRename error variable and add warn log on error PDU
pcarana [Tue, 26 Feb 2019 22:46:40 +0000 (16:46 -0600)] 
Rename error variable and add warn log on error PDU

7 years agoImplement serial logic, prepare to calculate diff between serials
pcarana [Tue, 26 Feb 2019 22:45:18 +0000 (16:45 -0600)] 
Implement serial logic, prepare to calculate diff between serials

7 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.

7 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

7 years agoImplement Cache Reset PDU (it has some TODOs to complete PDU exchange)
pcarana [Fri, 22 Feb 2019 15:51:34 +0000 (09:51 -0600)] 
Implement Cache Reset PDU (it has some TODOs to complete PDU exchange)

7 years agoAdd VRP flags to use at IPvx prefix PDU, and update PDU header length
pcarana [Fri, 22 Feb 2019 15:20:18 +0000 (09:20 -0600)] 
Add VRP flags to use at IPvx prefix PDU, and update PDU header length

7 years agoSend VRPs payloads, data buffer is now used from one place
pcarana [Fri, 22 Feb 2019 01:12:39 +0000 (19:12 -0600)] 
Send VRPs payloads, data buffer is now used from one place

7 years agoAdd missing stdlib header
pcarana [Fri, 22 Feb 2019 01:05:49 +0000 (19:05 -0600)] 
Add missing stdlib header

7 years agoAdd IPvx prefix PDU types and serialization, create buffer struct
pcarana [Fri, 22 Feb 2019 01:02:38 +0000 (19:02 -0600)] 
Add IPvx prefix PDU types and serialization, create buffer struct

7 years agoFix IP address serialization, and quick format to header decls
pcarana [Fri, 22 Feb 2019 01:00:05 +0000 (19:00 -0600)] 
Fix IP address serialization, and quick format to header decls

7 years agoMove all the send functions to new 'pdu_sender'
pcarana [Thu, 21 Feb 2019 17:31:47 +0000 (11:31 -0600)] 
Move all the send functions to new 'pdu_sender'

7 years agoFix a couple of bugs, implement Reset Query PDU handler.
pcarana [Wed, 20 Feb 2019 23:54:55 +0000 (17:54 -0600)] 
Fix a couple of bugs, implement Reset Query PDU handler.

Bugs fixed: add stdio.h, send VERDICT_SUCCESS if client_fd >= 0, use correct
pointer when handling PDUs (all at rtr.c).
Handle Reset Query PDU sending Cache Response and End of Data PDUs.
Add RTR version constants (0 and 1) and some PDU types for responses.

7 years agoAdd PDUs serializer and a common buffer writer
pcarana [Wed, 20 Feb 2019 23:33:34 +0000 (17:33 -0600)] 
Add PDUs serializer and a common buffer writer

7 years agoAdd intervals conf for RTRv1 End of Data PDU
pcarana [Wed, 20 Feb 2019 23:14:19 +0000 (17:14 -0600)] 
Add intervals conf for RTRv1 End of Data PDU

7 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]."

7 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.

7 years agoFix segfault when destroying vrps
pcarana [Tue, 19 Feb 2019 14:18:37 +0000 (08:18 -0600)] 
Fix segfault when destroying vrps

7 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

7 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

7 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.

7 years agoSave in memory the VRPs loaded from CSV
pcarana [Mon, 18 Feb 2019 16:29:40 +0000 (10:29 -0600)] 
Save in memory the VRPs loaded from CSV

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

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

7 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

7 years agoRead VRPs from a CSV file set at JSON config
pcarana [Thu, 14 Feb 2019 15:38:04 +0000 (09:38 -0600)] 
Read VRPs from a CSV file set at JSON config

7 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

7 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.

7 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`.

7 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

7 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

7 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

7 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.

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

7 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

7 years agoCode review
Alberto Leiva Popper [Thu, 7 Feb 2019 16:32:17 +0000 (10:32 -0600)] 
Code review

Patched some segfaults, removed some redundant code, added more
sensible defaults.

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

7 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

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

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

7 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

7 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

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

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

7 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.

7 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

7 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.

7 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

7 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

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

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

7 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.

7 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.

7 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

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

7 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.

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

7 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.

7 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