1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

234 Commits

Author SHA1 Message Date
job
e1686bd76c In anticipation of a bump of the ASPA eContent profile version, update
valid_econtent_version() to allow for non-zero versions.

OK tb@
2023-06-07 10:46:34 +00:00
job
08ac1330e7 Fixup file modification timestamps to optimize failover from RRDP to RSYNC
In the RSYNC protocol a file's last modification time and its size are
used to determine whether sending a (partial) copy over the wire is needed.
Previously, when RRDP data structures are serialized to disk, the mtime of
files in DIR_VALID ended up being UTIME_NOW.

Thus, the mtimes of files obtained through RRDP will never match the mtimes
of the same files available through RSYNC - causing each and every file to
be added to the file transfer list.

Instead, use the internal timestamps of RPKI files as the last modified
timestamp. Specifically, for Signed Objects (ROAs, MFTs, GBRs, TAKs, ASPAs)
the CMS signing-time, for .cer files the X.509 notBefore, and for .crl files
the CRL lastUpdate. This results in a surprising optimization for the number
files which have to be transfered.

OK claudio@
2023-05-30 16:02:28 +00:00
claudio
0876134d17 Revert commitid ANSBO0rBvIUtTi45:
Make rpki-client choose the verification time of the time it is invoked
   rather than always getting the current system time for every certificate
   verification. This will result in output that is not variable on run-time.

Using the time of invocation does not work well with fast publishing CAs. It
can take a few minutes to reach a repo and that CA may have issued certificates
that are not yet valid if that startup time of rpki-client is used to validate.

This still keeps the -P option to specify a fixed validation time.
OK beck@ job@ tb@
2023-05-30 12:14:48 +00:00
tb
967224c858 rpki-client: use partial chains in certificate validation
The generally rather poor quality RFC 3779 code in libcrypto also performs
abysmally. Flame graphs show that nearly 20% of the parser process is spent
in addr_contains() alone. There is room for improvement in addr_contains()
itself - the containment check for prefixes could be optimized quite a bit.
We can avoid a lot of the most expensive work for certificates with tons of
resources close to the TA by using the verifier's partial chains flag.

More precisely, in the tree of already validated certs look for the first
one that has no inherited RFC 3779 resources and use that as 'trust anchor'
for our chains via the X509_V_FLAG_PARTIAL_CHAIN flag. This way we can be
sure that a leaf's delegated resources are properly covered and at the same
time significantly shorten most paths validated.

Job's and my testing indicates that this avoids 30-50% of overhead and works
equally well with LibreSSL and OpenSSL >= 1.1. The main bottlenecks in the
parser process now appear to be SHA-2 and RSA/BIGNUM, two well-known pain
points in libcrypto.

This is based on a hint by beck and was discussed extensively with beck,
claudio and job during and after m2k23.

ok claudio job
2023-05-09 10:34:32 +00:00
beck
f0813572b9 Make rpki-client choose the verification time of the time it is invoked
rather than always getting the current system time for every certificate
verification. This will result in output that is not variable on run-time.

ok tb@ claudio@
2023-04-27 08:37:53 +00:00
beck
298d2ca0f5 Add a -P option to rpki-client to specify the evaluation time
This is intended to be able to test rpki-client in a reproducable
way without worrying about the system time changing the results

ok claudio@
2023-04-26 22:05:28 +00:00
claudio
1fc2657f8f Improve accounting by tracking things by repo and tal.
This fixes some wrong accounting for repositories that are referenced
from more than one TAL. It changes the ometric lable output a little bit
since there are repository metrics that no longer include the 'name' label.
OK tb@
2023-04-26 16:32:41 +00:00
job
32c8d2fec8 Check whether products listed on a manifest were issued by the same authority as the manifest itself
OK tb@
2023-04-13 17:04:02 +00:00
claudio
d0837792d2 Add the protocol used to sync the repository to the open-metric output.
OK tb@
2023-03-30 15:29:15 +00:00
job
894936b4b8 In filemode, display the moment the signature path will expire
Previously this was only shown for ROA+ASPA. Now also show for
GBR, Geofeed, Certs, RSC, and TAK.

OK tb@
2023-03-13 19:51:49 +00:00
job
4dbb22b8de Rename some data fields to closer match their provenance
OK tb@
2023-03-13 09:24:37 +00:00
job
534b66744e Refactor expiration calculation
Unify common code paths which find the exact expiry moment into a new
helper function. Additionally, the new helper offers more accuracy by
checking more applicable CRLs whether their 'nextupdate' is 'sooner'.

tb@ noted: The helper adds a multiplier of log(#crls), but that's
certainly acceptable as it is still very cheap.

OK tb@
2023-03-12 11:54:56 +00:00
job
9f54482206 mechanical change, rename struct members to match the original X509 names
OK tb@
2023-03-10 12:44:56 +00:00
job
f5999ddfaa Show the X.509 notBefore in filemode
OK tb@
2023-03-10 12:02:11 +00:00
job
f904f2a228 In filmode also show 'Not After' for GBR records
OK tb@
2023-03-09 12:54:28 +00:00
job
1bb1e5098b Show CMS signing-time signed attribute in filemode
OK tb@
2023-03-09 09:46:21 +00:00
job
ae36eebee8 Add check for RSA key pair modulus & public exponent
Both the SPKI inside a CA's .cer TBS section and Signers wrapped in CMS
must be RSA, with mod 2048 & (e) 0x10001

OK tb@
2023-03-06 16:04:52 +00:00
claudio
acb55ac272 Add aspa-set to openbgpd config output.
Change the way the validated ASPA tree is built since OpenBGPD config
follows more the ASPA profile and puts the optional AFI to each provider
ASnum instead of duplicated everything into an IPv4 and IPv6 tree.
The JSON output of ASPA is still the same.

The inclusion of the aspa-set can currently be disabled by the -A flag.
OK tb@
2023-01-13 08:58:36 +00:00
claudio
45735add95 Validate the session_id to be a real UUID.
RFC 8182 requires the session_id to be a version 4 random UUID (using
variant 1). Now checking the version and variant is currently disabled
because there is at least one CA with a session_id that is all random
and therefor the version check triggers there.
Joint work with job@. OK job@, tb@
2023-01-04 14:22:43 +00:00
jmc
3a50f0a93a spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech
2022-12-28 21:30:15 +00:00
claudio
4f5f25cbf9 Rework statistic collection to be per repository and add metric output option
Many statistic values are now accounted by repository via repo_stat_inc()
At end of the run sum_stats() accumulates these stats per TAL and globally.
The new output file metrics is written when the -m output flag is specified.
The metrics file is written in OpenMetrics format (with a few tweaks to
allow node_exporter to parse the file as well). The ometric code is a copy
from bgpctl(8) and should be kept in sync.
OK tb@
2022-12-15 12:02:29 +00:00
claudio
65c1cececa Switch to struct timespec for collecting stats. This allows to use
clock_gettime(CLOCK_MONOTONIC) for runtime calculation.
OK tb@
2022-12-14 10:34:49 +00:00
claudio
fd7a2857fa Return an error string instead of surpressing the warning in valid_x509.
This way manifests can should a better error message when something fails.
With and OK tb@
2022-11-29 10:33:09 +00:00
job
ef3f6f56d6 Add support for authenticating geofeed data CSV files in filemode
RFC 9092 describes a scheme in which an authenticator is appended to a
geofeed (RFC 8805) file. It is a digest of the main body of the file
signed by the private key of the relevant RPKI certificate for a covering
address range. The authenticator is a detached CMS signature.

with and OK tb@
2022-11-26 12:02:36 +00:00
tb
087f54cd99 Move skiplist to main and merge with shortlist.
With/ok job
2022-11-18 14:38:34 +00:00
tb
7856f77c0d whitespace 2022-11-04 12:05:36 +00:00
job
2cf0e12255 Check the SIA signedObject in ROA/MFT/ASPA/TAK/GBR EE certificates
Unfortunately we can't yet error out when accessMethods other than
signedObject are encountered in the SubjectInformationAccess extension
because there is pollution in the ecosystem.

OK tb@
2022-11-04 09:43:13 +00:00
job
ee2a33daae Add support for draft-ietf-sidrops-signed-tal-12
Add support validation of Signed Objects containing Trust Anchor Keys
(TAKs - aka 'Signed TALs'). Signed TALs provide a mechanism for RIRs
to distribute and sign the next Trust Anchor with the current Trust
Anchor. This might be an improvement over visiting RIR websites and
copy+pasting TAL data by hand.

OK tb@
2022-11-02 12:43:02 +00:00
job
91176c18e4 Properly free() crl & auth tree in parser process
OK claudio@
2022-09-03 21:24:02 +00:00
job
c9e39c9516 Introduce x509_any_inherit() for objects which may not have inherit elements
Unify conformance checking of Trust Anchors, ROAs, ASPAs, RSCs - none of which
may have any 'inherit' elements in the RFC 3779 IP/AS Resources extension of
the X509 certificate.

OK tb@
2022-09-03 14:40:09 +00:00
claudio
c94cf4486d Add the repoid of the cert in the cert struct. This way it is possible
to track the parent repository id of a publication point.
Nomenclature is confusing but not much we can do here.
OK tb@ job@
2022-09-03 13:30:27 +00:00
claudio
0cda9bffbf Use the abort commands when a repo timeout happens. This is cleaner
then just failing the repo fetch but leaving the backends running.
OK tb@
2022-09-02 19:10:36 +00:00
claudio
4673c6835c Implement RRDP_ABORT, a message to abort a inflight RRDP request.
The abort is done in a way that waits for any inflight files or http
requests to finish before removing the rrdp state and before sending
the rrdp done message indicating failure.
OK tb@ and benno@
2022-09-02 18:37:17 +00:00
job
a29ddfd5ea Add support for ASPA objects (draft-ietf-sidrops-aspa-profile-10)
ASPA objects are published in the RPKI and can be used to detect and
mitigate BGP route leaks. Validated ASPA Payloads are visible through
filemode (-f) and the JSON output format (-j).

With feedback from tb@

OK claudio@ tb@
2022-08-30 18:56:49 +00:00
tb
99dbdb7f37 Check the resources in ROAs and RSCs against EE certs
The resources delegated in the RFC 3779 extensions of the EE cert for
ROAs or RSCs can be a subset of the resources in the auth chain. So far
we compared that the resources of ROAs and RSCs are covered by the auth
chain, which is not entirely correct. Extract the necessary data from
the EE cert into rpki-client's own data structures, then verify that
the EE cert's resources cover the ones claimed in the ROA or RSC.

Do this as part or ROA and RSC parsing, that the EE cert's resources are
covered by the auth chain is checked in valid_x509() later on.

All this is a bit more annoying and intrusive than it should be...

ok claudio job
2022-08-19 12:45:53 +00:00
job
8210c72b2e Remove dangling ASPA references until we land real support
OK tb@
2022-08-18 15:20:27 +00:00
job
8cae3ce1b5 Clarify and tidy up some comments
OK tb@
2022-08-17 11:57:46 +00:00
job
194059d2ff Decrease how long to wait for the remote peer to send IO before giving up
If a repository is uncommunicative, rpki-client will try other transports,
or come back later (because of a next crontab invocation).

OK claudio@
2022-08-10 10:27:03 +00:00
claudio
9170c2da45 Make the http code respect MAX_CONN_TIMEOUT and fail connects once they
hit this timeout. This is in line with the rsync code.
OK tb@ job@
2022-08-09 09:02:26 +00:00
job
2778dc2559 Unify the maximum idle IO timeout for RSYNC & HTTPS
OK claudio@
2022-08-08 15:22:31 +00:00
job
fcf9359d66 Set rsync connection timeout to 15 seconds.
OK sthen@
2022-08-08 14:10:10 +00:00
job
5a2857b60b Add skiplist option to steer clear of skiplisted hosts
Blocking outbound connections towards RPKI publication servers based
on IP or IPv6 address in external instrumentation like HTTP proxies
or pf(4) rules is somewhat unwieldy. It might be easier for operators
if we offer a mechanism that cuts at the CA cert SIA parsing step.

OK claudio@ tb@
2022-06-27 10:18:27 +00:00
tb
8e5b983981 Dedup econtent version checks
Since the ASN.1 template conversions, we have three copies of mostly dead
code that validates that the econtent version is at its default value 0.
Until a new standard bumps this version and we decide to support that,
we're better off with only one copy of this code.

ok claudio
2022-06-10 10:36:43 +00:00
tb
c891374240 Limit the number of RSC checklist FileNameAndHash entries the same way
as mft FileAndHash entries are checked.

ok claudio job
2022-06-01 10:59:21 +00:00
tb
3cba554a5d Remove now unused ASN1_frame() and cms_econtent_version()
ok claudio job
2022-05-31 18:41:43 +00:00
tb
565a9191f8 Prepare rewrite of rsc.c with templated ASN.1
Change signatures of various functions to avoid using struct parse and
expose sbgp_as_{id,range}() and sbgp_addr{,_range}() so they can be used
from rsc.c. This is a mostly mechanical diff.

ok claudio job
2022-05-31 18:33:16 +00:00
claudio
6e7e52893b Introduce MAX_HTTP_REQUESTS and MAX_RSYNC_REQUESTS.
These just replace MAX_CONNECTIONS and MAX_RSYNC_PROCESSES to be more unified.
OK tb@
2022-05-24 09:20:49 +00:00
job
3a363cbd2e Verify MFT and GBR objects only carry RFC 3779 extensions set to 'inherit'
OK claudio@ tb@
2022-05-11 21:19:06 +00:00
job
e6c729cde6 In filemode check whether ROA & RSC resources are properly contained
with and OK tb@ claudio@
2022-05-11 14:42:01 +00:00
tb
203dfefc80 Validate RSC filenames
Factor out POSIX portable filename check into a new valid_filename() and
rename the previous valid_filename() to valid_mft_filename().  Fixes and
supersedes imcomplete checks in the RSC code. Avoids truncation via
strndup() in case of embedded NULs.

input/ok claudio
2022-05-10 07:41:37 +00:00
tb
bfcdb7857b Drop prototype of currently nonexistent function. 2022-05-09 17:19:32 +00:00
job
04834fbd7a Add preliminary support for decoding RSC objects in filemode
This implements decoding support for draft-ietf-sidrops-rpki-rsc-06

There are three major outstanding issues:

* The wire image might still change to conform to the more widely deployed
  3779 API in libressl/openssl. IETF discussion ongoing.
* Whether the resources listed in the ResourceBlock are contained within
  the EE's RFC 3779 extension is not hooked up yet.
* There is a fair bit of duplicity between rsc.c and cert.c, look for XXX

OK tb@
2022-05-09 17:02:34 +00:00
claudio
ad462a11c7 Further refactor and cleanup filemode.c mainly remove the copies of
proc_parser_cert_validate() and proc_parser_root_cert() adjust
parse_load_certchain() and parse_load_ta() respectivly.
Also cleanup the functions in parser.c and make it possible to call
ta_parse and cert_parse with a NULL cert.
OK tb@
2022-04-21 12:59:03 +00:00
claudio
c4a9443c2d The filemode code is enough different from the regular parser code that it
makes sense to totally split it out. Duplicate proc_parser_cert_validate()
and proc_parser_root_cert() for now.

The valid_x509() plus the required static functions are moved to validate.c.
The crl_tree code moved into crl.c similar to the auth_tree handling in
cert.c. All the proc functions are now tagged with __attribute(noreturn)
which allows to remove the errx() after them.

OK tb@
2022-04-21 09:53:07 +00:00
deraadt
bdbde0472c more whitespace cleanups 2022-04-20 15:38:24 +00:00
job
530399e88e Add Concatenated JSON output in filemode (rpki-client -j -f *)
The schema is still work in progress.

OK claudio@
2022-04-20 10:46:20 +00:00
claudio
389eb2093e Change type of talsz and dependent code from size_t to int. Tal ids are
already stored as int and and talsz is the limit for these ids.
OK tb@
2022-04-19 13:52:24 +00:00
claudio
23bc08f8ba Adjust on how CRL and MFT files are verified.
Verify the CRL referenced from the mft against the mft's fileAndHash info.
If the CRL matches then load it and use it to validate this mft. If the
mft validated OK add the now also valid CRL to the auth store for later use.

Before the newest CRL was always selected but that has negative consequences
because it is common practice to revoke the previous MFT's EE cert and with
that the cache is turned useless as soon as a new CRL is used. Also there
was a possibility that the CRL used for validation of the MFT was not the
one later used.

Both RFC6486 and draft-ietf-sidrops-6486bis are unclear about this part
of the validation process. We opted in favor of the chached MFT.

With and OK tb@
2022-04-19 09:52:29 +00:00
tb
33e36affb4 Generalize sbgp_sia_location() to x509_location()
AIA and CRL URIs can reuse the code in sbgp_sia_location and thus get the
same checks as the SIA locations. This eliminates some more duplication
and makes the checks more stringent in that embedded NULs and "./" are no
longer allowed.

ok claudio
2022-04-12 08:45:34 +00:00
claudio
6cf9bac277 Adjust cache cleanup to the deficits of RRDP. Unlike rysnc, RRDP has no
method to sync the cache. It just depends on all deltas to work but has
no method to check if the result is consistent with the source.
Because of this do not unlink files which were fetched via RRDP. Instead
move them back to their .rrdp directory and hope the will be cleaned up.
This should help to keep the cache coherent in some edge cases.
OK tb@
2022-04-04 16:02:54 +00:00
claudio
ba153bd8ee Split certificate parsing in two steps. cert_parse_pre() which does
the parse and some checks and cert_parse() or ta_parse() to do the
additional checks for regular certs or TAs.
With this adjust the cert parser in -f mode to identify TAs (by checking
if it is self signed) and adjust the validation in that case. Now -f
should be able to parse and show all object correctly.
With and OK tb@
2022-04-02 12:17:53 +00:00
claudio
f999fe57db Change x509_get_aki(), x509_get_ski(), x509_get_aia(), and x509_get_crl()
to work more like x509_get_expire(). They will return an error if the
extension extraction failed but not if it was not present. The callers
must now do that check but most did already.
With this cert_parse_inner() no longer cares about TA vs non-TA certs.
Feedback and OK tb@
2022-04-01 17:22:07 +00:00
job
326af69396 Sync & permit ASPA objects to appear on Manifests
OK tb@ claudio@
2022-03-31 12:00:00 +00:00
job
9363012ef2 Name the maximum number of deltas permitted in a RRDP Notification file
OK claudio@ tb@
2022-02-14 14:46:16 +00:00
claudio
7cdd491f06 Fix serial number printing in crl_print() for large serials.
Create a common x509_convert_seqnum() function to convert the various
ASN1_INTEGERs into hexnumbers and use this for mft and crl handling.
With and OK tb@, also OK job@
2022-02-10 17:33:28 +00:00
claudio
220c707c54 Implement some code to print crls with -f.
For this introduce x509_get_time() that converts a ASN1_TIME to time_t.
Also move time2str() to print.c where it makes more sense.
This needs more work but that will happen in tree.
OK tb@
2022-02-10 15:33:47 +00:00
tb
d7e950379a Check CRLs also for manifests
There is a chicken-egg here since manifests reference the CRL themselves.
We may also have two CRLs available, in which case we check against the
one with the newer thisUpdate time.

The RFC situation is a bit of a mess with abundant complexity, unclear
recommendations and requirements and draft specs that also need to be
considered. This is a first version that works with future improvements
to be landed later.

Joint work with claudio, prompted by a question by job

ok claudio job
2022-02-08 14:53:03 +00:00
tb
4bd8ba3acf Move the guts of proc_parser_crl() into crl_parse(). This is actually
parsing the CRL, so it makes more sense to have it there. It will also
make an upcoming change easier. While there, rename free_crl() into
crl_free() for consistency with all other *_free() functions.

input/ok claudio
2022-02-08 11:51:51 +00:00
claudio
df512fbc9f Properly handle .mft files as intended by the RFC. Instead of always
selecting the newest file this opens both the new (from rrdp or rsync)
and old (valid) MFT. It then compares the manifest number and based on
that the 'newer' MFT is selected.
The MFT file and hash check is also changed to always try both locations
and selecting whatever matches up with the hash. The selction is passed
back to the the main process and used later on to open exactly the same
file as was checked against the hash.
The MFT parsing code has been split up into multiple steps so that the
files can be parsed, compared and then fully validated.
In most cases this makes no difference but it prevents replay attacks
using old but still valid files.
With and OK tb@
2022-01-28 15:30:23 +00:00
claudio
685326f577 Adjust code to handle unsupported file types a bit more graceful.
The file still needs to match its hash to make the MFT valid but then
there will only be a warning printed. Parsing of other files from that
MFT are not influenced.
OK tb@
2022-01-24 17:29:37 +00:00
claudio
7ba5db230c Handle EINTR the same way in all poll loops. In all cases restart the
poll loop. In the main process move the timeout handling for repositories
into a single function that does the timeouts and the calculation of the
timeout in one go.
OK tb@
2022-01-23 12:09:24 +00:00
claudio
24069af1d0 Simplify valid_cert() and valid_roa() by passing in struct auth instead
of looking it up again. For this valid_roa() needs to be moved up in
proc_parser_roa() also move out the assignment of the TAL id. Not the
right thing to alter an object in a validation function.
OK tb@
2022-01-23 05:59:35 +00:00
tb
043caafece Change valid_filename() ot return an enum rtype and rename it to
rtype_from_mftfile(). Move both rtype_from functions to mft.c.

ok beck claudio
2022-01-22 09:18:48 +00:00
tb
22cec6c4df Add function to determine the file type from the file name extension
rpki-client uses the same idiom to determine the file type in too many
places. Use one function that determines the appropriate RTYPE from the
file name. Add that type to struct mftfile and use this new member to
simplify queue_add_from_mft*().

input/ok claudio
2022-01-21 18:49:44 +00:00
claudio
487aa6cb3a Rename mft_check() to proc_parser_mft_check() and make it a static function. 2022-01-20 09:24:08 +00:00
claudio
f43c4d922e Implement a filemode where the passed file from the command line is
printed in human readable form and is also verified against the valid
cache of rpki-client.

To validate the file the chain is explored backwards by looking at the
Authority Information Access URI and X509v3 CRL Distribution Point of
the cert. Once the trust anchor is found this chain can be verified.

Feedback and OK job@ tb@
2022-01-19 15:50:31 +00:00
claudio
9551aa73ca Change cert_parse() and ta_parse() to no longer take a x509 handle as
argument. The x509 cert is also inside struct cert and easy to access.
Also switch auth_insert() to a void function since it can't fail.
OK tb@
2022-01-18 16:36:49 +00:00
claudio
d3c7e8168c Revert all the files that should have not been committed in last commit. 2022-01-18 16:24:55 +00:00
claudio
ba7feb83a4 Kill extra newline 2022-01-18 16:18:22 +00:00
claudio
de9b6f5d99 Cleanup the scattered OBJ_txt2obj() calls and move them into
x509_init_oid() to initalize all necessary OID objects at start.
OK tb@
2022-01-18 13:06:43 +00:00
claudio
0c3a233597 Introduce a validated cache which holds all the files that have
successfully been verified by rpki-client.

With this the rsync and rrdp directories are more of a temporary storage
location. New files are downloaded there and then moved to the valid
directory at the end. In -n mode only the valid directory is looked at with
the exception of the ta directory holding the trust anchors.
A file can now be in two different locations so adjust all the code paths
that open files to check both locations.
One nice side-effect of this is that the RRDP handling in the main process
got simplified. There is no longer the need for temporary RRDP directories.
OK tb@
2022-01-14 15:00:23 +00:00
claudio
87c7c78d66 Alter valid_filehash() to take a file descriptor instead of a path.
This is needed so that callers can allow a file to be in multiple
locations. Also move mft_check() from mft.c to parser.c.
OK tb@
2022-01-13 13:46:03 +00:00
claudio
264f4ef9cf Implement a RRDP_CLEAR message that instructs the parent to cleanup
the rrdp directory. This is used before a snapshot download to ensure
that the snapshot is applied to a clean repo.
Similar cleanup happens if the transfer fails. In that case remove the
temp directory contents only.
This uses a new function remove_contents() to remove everything below
a base directory (a bit like rm -r X/*).
OK tb@
2022-01-13 13:18:41 +00:00
claudio
100ded9e8b Change the way the parser accesses files. It now builds the file path
based on information from the repository, a local path and the filename.
This simplifies some code both in the main process and the parser.
For this to work repositories are passed to the parser before any other
entity of this repository is passed. Struct entity is extended to include
the repoid and the path along the file(name).
Input and OK tb@ & job@
2022-01-11 13:06:07 +00:00
claudio
08df5e84f3 Cleanup struct entity. Remove the unneeded has_data field, the same
information can be figured out by looking at the data pointer itself.
It is NULL when there is no data and not-NULL if there is data.
OK benno@
2021-12-29 11:37:57 +00:00
claudio
b6884e9f8f Replace two questionable size_t types. For the repo id use a unsigned int
and for the roa maxlength use unsigned char (like the prefixlen in struct
ip_addr).
With input and OK job@
2021-12-22 09:35:14 +00:00
job
cecb080267 Replace MAX_REPO_TIMEOUT with repo_timeout, which is set to 1/4th of
timeout, or if timeout is disabled set to 24 hours.

OK claudio@
2021-11-25 14:03:40 +00:00
claudio
aef00ae0fc Move some functions from rrdp.c to rrdp_util.c and hex_decode to encoding.c.
This will make it easier to write a RRDP regress test.
OK job@ deraadt@
2021-11-24 15:24:16 +00:00
job
9f2d8e54a0 Increase maximum filesize of RPKI objects to 4MB
Based on feedback from Ties de Kock

OK tb@
2021-11-10 08:34:48 +00:00
claudio
7af68c5c1d Limit the number of publication points under a given TAL.
Introduce an additional timeout for each publication point.

The limits are large enough to accomodate normal operating levels.

With and OK benno@ job@ tb@ beck@ deraadt@
2021-11-09 11:03:39 +00:00
claudio
4ef6f69353 Simplify how IP addresses and AS numbers are passed between processes.
Since they are stored in an array just blast the full array in and out
of the io buffers at once instead of iterating element by element.
It also allows to remove a lot of extra code.
OK benno@ job@
2021-11-05 10:50:41 +00:00
claudio
2cc3b5f121 Move and promote getmonotime() to an internal API function. 2021-11-04 14:24:41 +00:00
claudio
4120df8f0f Use the same spacing for all defines. 2021-11-04 14:21:19 +00:00
claudio
dc508150ce Instead of passing tal descriptions around just pass a tal id and
use a small lookup table to print the description in the output path.
OK tb@
2021-11-04 11:32:55 +00:00
claudio
36dac55ee8 Limit the number of rsync processes being spawned by stopping to accept
new requests when over the limit. Use a generous limit of 16.
OK deraadt@
2021-11-03 14:59:37 +00:00
claudio
86832a4c4e Move the MAX_CERT_DEPTH to extern.h and adjust the comments of all limits
a bit.
2021-11-03 10:50:18 +00:00
claudio
198a05209c Further simplify cert and auth handling. Move common code into auth_insert
and skip this distinction between invalid and failed certificates.
The difference between the to is getting more and more blurry.
OK tb@
2021-11-01 17:00:34 +00:00
claudio
cebe825985 Cleanup struct auth a bit. The tal description is also stored in the cert
and the filename is only used in tracewarn which is not that helpful.
OK tb@
2021-11-01 09:12:18 +00:00
claudio
93d9375cd8 Ensure that RRDP snapshot and delta files are fetched from the same host
as the notification file.
OK tb@ job@
2021-10-29 09:27:36 +00:00
job
ac69bfd295 Limit how many FileAndHash entries a single manifest may contain
OK claudio@
2021-10-28 13:51:42 +00:00