summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client
AgeCommit message (Collapse)Author
2022-09-09Bump version to 8.0Claudio Jeker
2022-09-09Adjust chunked encoding handling.Claudio Jeker
Add an extra state to distinguish in between chunks CRLF handling from the last chunk which can optionally have some trailer fields included. rpki-client ignores these trailer header fields (they are also not common it seems). Also remove the empty line handling in http_parse_chunked() for explicit checks in http_read(). Because of the extra state the switch back to non-chunked mode can now be delayed until the transfer is over. OK tb@
2022-09-08In http_get_line() additionally strip any trailing space or tab from lines.Claudio Jeker
In many places the HTTP allows for extra spaces which need to be ignored. Similar the chunked encoding extensions are separated from the chunk size by a ':' but the spec also allows for bad whitespaces in all shapes and forms. Adjust the logic in http_parse_chunked() to stop when the first space, tab or ':' is seen. There is no need to check for newlines since those are stripped by http_get_line(). OK tb@
2022-09-08Adjust HTTP header parsing to follow RFC more closely.Claudio Jeker
RFC9112 allows any amount of space/tabs between the ':' and the value. Until now this code required exactly one space which works most of the time but is not RFC compliant. Problem reported by Ties de Kock (tdekock (at) ripe.net) OK tb@
2022-09-06Properly free memory in filemodeJob Snijders
OK tb@
2022-09-05Update to most recent specJob Snijders
2022-09-05Reset provider in each iterationTheo Buehler
If a providerAS sets an afiLimit, subsequent providerAS that don't set it would erroneously inherit that limit. Zero out the provider at the top of the loop to avoid this problem. ok job
2022-09-05Don't leak cert in aspa_parse()Theo Buehler
ok job
2022-09-03Properly free() crl & auth tree in parser processJob Snijders
OK claudio@
2022-09-03Clarify warningJob Snijders
2022-09-03Don't doublecheck whether the RSC eContent Resourceblock contains inherit ↵Job Snijders
elements The RSC ASN.1 templates make it impossible to pass an RFC3779-style inherit option because of the use of ConstrainedIPAddressFamily and ConstrainedASIdentifiers. OK tb@
2022-09-03Introduce x509_any_inherit() for objects which may not have inherit elementsJob Snijders
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-03Add the repoid of the cert in the cert struct. This way it is possibleClaudio Jeker
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-03Allow multiple X.509 locationsTheo Buehler
While currently everyone only uses a single location, the spec allows for multiple locations ordered by preference. While rpki-client does not support more than one location this should not be a fatal error. Instead, pick the first location and warn if there are more than one. ok job
2022-09-03Move non-inheritance check for BGPsec certs into cert_parse_pre()Theo Buehler
ok claudio job (as part of a larger diff)
2022-09-03Clarify timeout/deadlineJob Snijders
2022-09-03Move the repo lookup into queue_from_mft()Claudio Jeker
OK tb@
2022-09-02Introduce a deadline timer that aborts all repository syncs.Claudio Jeker
With this rpki-client has a chance to still finish and produce an output even when a CA is excessivly slow and holds back progress. With and OK benno@ tb@ and job@
2022-09-02Fix over long linesClaudio Jeker
OK tb@ job@
2022-09-02Use the abort commands when a repo timeout happens. This is cleanerClaudio Jeker
then just failing the repo fetch but leaving the backends running. OK tb@
2022-09-02Implement RRDP_ABORT, a message to abort a inflight RRDP request.Claudio Jeker
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-02rrdp_new() need not return the structTheo Buehler
The only caller does nothing with it. with/ok claudio
2022-09-02extra newlineClaudio Jeker
2022-09-02Move mkpath logic after checking for 'noop' to prevent creation of ↵Job Snijders
directories in -n mode OK claudio@
2022-09-02Rework the rsync proc code. Use a proper queue of requests and enforceClaudio Jeker
the limit on that queue instead of stopping to read new messages. This is needed to implement an abort request. "There is not enough RB_TREE in this diff" tb@
2022-08-30stray tabTheo Buehler
2022-08-30whitespaceTheo Buehler
2022-08-30Avoid dead assignmentTheo Buehler
2022-08-30Add support for ASPA objects (draft-ietf-sidrops-aspa-profile-10)Job Snijders
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-30Avoid leak in proxy_parse_uri()Theo Buehler
with/ok claudio
2022-08-30In RRDP mode it is possible that a file in the validated cache dir isClaudio Jeker
no longer valid while the newer file in the .rrdp directory is not (yet) valid. In this case do not copy the old file over the newer file. RRDP has no method to identiy inconsistent repos (unlike rsync) so if the wrong file is put in .rrdp it is not noticed appart from the verification process failing for that file. OK tb@ job@
2022-08-29Simplify load_skiplist()Theo Buehler
Instead of copy-pasting valid_uri(), we can call the real thing. That's also not ideal since we actually check for an FQDN, but it's a bit simpler. ok claudio
2022-08-26Tweaks in load_skiplist()Theo Buehler
If there's an issue opening the default skip list file other than its absence (most likely bad permissions), we should not silently ignore that. Also, use err() instead of errx() to display the error. Second, linelen, the return value of getline(), is not currently used. Repurpose it to save the result of strcspn() which calculates the length of the string we're interested in and use that instead of strlen(). ok claudio
2022-08-25Make PEM printing available through increased verbosity (-vvf)Job Snijders
Suggestion from claudio@ OK tb@
2022-08-25In verbose filemode print details about encapsulated certificates.Job Snijders
Add command line flag to print the certificate in PEM format. OK tb@
2022-08-25Fix newline in JSON filemodeJob Snijders
OK tb@
2022-08-25Plug memory leak in filemodeJob Snijders
OK tb@ claudio@
2022-08-22An RSC's EE cert mustn't have a SIA extensionTheo Buehler
Explicitly forbidden in sections 2 and 5 of draft-ietf-sidrops-rpki-rsc-10. looks good to claudio
2022-08-19Check the resources in ROAs and RSCs against EE certsTheo Buehler
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-18Remove dangling ASPA references until we land real supportJob Snijders
OK tb@
2022-08-17Clarify and tidy up some commentsJob Snijders
OK tb@
2022-08-12No need to make a deep copy of the EE certTheo Buehler
The EE Cert has just been allocated as part of deserializing the cms. There is no need for an expensive copy, we can just keep a reference. ok job
2022-08-10Clarify warning related to ROA eContentJob Snijders
2022-08-10Disallow AS Resources extension on ROA EE certificatesJob Snijders
The ROA specification (RFC 6482 section 4) is a bit underspecified, however in the wild the RFC 3779 AS Resources extension never ever appears on ROA EE certificates, as it serves no purpose in the validation process. OK tb@
2022-08-10Decrease how long to wait for the remote peer to send IO before giving upJob Snijders
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-09Make the http code respect MAX_CONN_TIMEOUT and fail connects once theyClaudio Jeker
hit this timeout. This is in line with the rsync code. OK tb@ job@
2022-08-08Unify the maximum idle IO timeout for RSYNC & HTTPSJob Snijders
OK claudio@
2022-08-08Set rsync connection timeout to 15 seconds.Job Snijders
OK sthen@
2022-08-04Once all files from argv have been read the main process can unveil toClaudio Jeker
the cachedir and if output files are written to outputdir. In -f mode the unveil can be read-only in normal operation rwc is required because the main process writes the RRDP files and also does the cleanup at the end of the run. Input from tb@ and mestre@, OK tb@
2022-07-28Fix RFC number in commentTheo Buehler