summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client
AgeCommit message (Collapse)Author
2021-01-12rsync is using buffered output now, so remove this FIXME commentClaudio Jeker
2021-01-08Simplify the entity queue processing. There is no need to keep the entityClaudio Jeker
queue element around once it is sent to the parser process. Instead just keep a count of pending entities and make the parser send back the entity type instead of the id (since this is the only field needed to figure out what to do). OK job@
2021-01-08Start using the ibuf API (ibuf_dynamic, ibuf_add, ibuf_close) for writingClaudio Jeker
data between processes. This completely decouples the write side. rpki-client can't really use the imsg framework but it can use the ibuf bits wich imsg is built on. OK benno@ job@
2020-12-29Fix calloc in GBRjob
OK claudio@
2020-12-21Now that a NULL string is marshalled as NULL again we can drop someClaudio Jeker
extra has_xyz integers to indicate if the following buffer is present or not. At the same time sprinkle some asserts for strings which must be not NULL. OK tb@
2020-12-18In io_str_read() return 0-length strings as NULL pointers instead ofClaudio Jeker
empty strings. There are no empty strings being passed around but a fair amount of optional strings and this will simplify this code. OK tb@
2020-12-18Use asprintf with %.*s to construct the path based on the mft fileClaudio Jeker
location and the filename of the referenced file. Use the same method both in main.c and mft.c which is a fair bit simpler than using calloc and strlcpy/strlcat to build the string by hand. OK tb@
2020-12-09Lets claim RFC6493 support.Claudio Jeker
2020-12-09Validate ghostbuster records (RFC 6493) but for now do nothing with theClaudio Jeker
provided vcard payload. This change verifies the certificate of the .gbr file and makes sure it is valid (like we do for e.g. .roa files). OK job@
2020-12-09All files provided in a manifest needs to be checked against the providedClaudio Jeker
hash even if rpki-client ignores this file later on. OK job@
2020-12-07Limit the URL embedded in .cer files to only consist out of isalnum orClaudio Jeker
ispunct characters. Everything else is fishy and so block those early on. OK millert@ job@
2020-12-03Make sure that the strcasecmp for .tal is only done if dlen is large enough.Claudio Jeker
Found by naddy@
2020-12-03Use strndup() instead of hand rolling our own version.Claudio Jeker
OK naddy@
2020-12-02Remove the last users of io_*_write functions that call io_simple_write()Claudio Jeker
internally. This is a step in direction of more async aware io in rpki-client. Now everything uses a buffer which is then written. OK tb@
2020-11-24Kill connection if rsync server stallsjob
OK deraadt@
2020-11-068 spaces -> tabTheo Buehler
2020-11-06Treat stale manifests as such, not as 'failed to parse'Theo Buehler
There is currently dead code in mft_parse() that handles stale manifests by setting the stale flag and removing all files they reference. This code was made unreachable in a refactor that fixed a logic error that made mft_parse() succeed despite its error handling. check_validity() returns three possible values. Report failures and stale mfts back immediately via rc. Success needs to reset rc to -1, so subsequent errors are reported as such. This is mostly cosmetic and only changes the rpki-client output in that the comment at the top of the config now actually shows stale manifests. This makes regress pass again. ok claudio job
2020-11-05typoTheo Buehler
2020-11-05Fix checks for manifest validity intervalTheo Buehler
The check_validity() function used the X509_cmp_time() functions with GeneralizedTime. This doesn't work with current dates since LibreSSL enforces conformance with RFC 5280 in X509_cmp_time(), which requires that dates before 2050 are represented with UTCTime. The functions would return an error, but missing error checking led to failing to detect expired or not yet valid manifests. Fix this by converting the dates into struct tm and using ASN1_time_tm_cmp() instead. With input from claudio, jsing ok benno claudio jsing
2020-10-24queue_add_from_cert() and queue_add_from_tal() are both called with properlyClaudio Jeker
validated certs / tals and there is no need to double check if the URIs point to the right resource again. rtype_resolve() is now unused and can be removed. OK tb@
2020-10-24Refactor sbgp_sia_resource_mft() similar to sbgp_sia_resource_notify().Claudio Jeker
Instead of rsync_uri_parse() check the start of the uri for rsync:// and also check that the uri ends in .mft. OK tb@
2020-10-23sort options list;Jason McIntyre
2020-10-23Align man with realityjob
OK claudio@ deraadt@
2020-10-11Implement more of RFC 8630 and support more than one URI in the TAL file.Claudio Jeker
The URI are sorted which results in preferrence of https URI. To make rpki-client's handling easier enforce that all URI use the same filename. OK benno@
2020-10-11Introduce repo_filename() a function that converts a URI into the localClaudio Jeker
path to that resource. This will be needed for future RRDP support. Additionally support more then one TAL URI and select the rsync URI in that list. Finally queue_add_from_cert() got modified to include both the rsync URI and the RRDP notify URI (which is still unused). OK benno@
2020-10-01In OpenSSL 1.1.x EVP_ENCODE_CTX is an opaque struct and has to beClaudio Jeker
allocated with EVP_ENCODE_CTX_new(). Do this once on the first call and keep the context around for all subsequent calls. OK tb@ and benno@
2020-10-01Rewrite the signal handler to just toggle a flag and then exit asapClaudio Jeker
in the main loop. This removes a few portability issues. OK benno@
2020-10-01Make the repotab (rt) a global instead of passing the value around asClaudio Jeker
an argument. Will help with further changes. OK benno@
2020-10-01Use correct way to report error when strtonum fails.Claudio Jeker
Use errx(), remove the extra \n and use the correct argument (-s not -t).
2020-09-30Instead of using the kind of hidden b64_pton() from libc resolv.h switchClaudio Jeker
to the -lcrypto base64 decoder using EVP_Decode* this is more portable. With and OK tb@, OK benno@ (on a less polished version)
2020-09-15Align man page with realityjob
sure benno@
2020-09-15Experienced a situation where (older code) rpki-client+openrsyncd got "stuck"Theo de Raadt
(for an amusing long time), so that the partnership with cron "~ -ns" could not make progress ingesting new ROAs. Add a "-s timeout" feature (default 1H, 0 to disable) after which rpki-client gives up the ghost, allowing cron to perform a fresh try. Log loudly when this occurs. ok job claudio beck
2020-09-12Include openssl/x509.h in extern.h since it uses a few of the typedefs fromClaudio Jeker
there in structs and prototypes. Remove the openssl/ssl.h and other strange openssl includes in the .c files that don't use openssl specific functions. OK beck@ and tb@
2020-09-12Remove last two arguments from repo_lookup() since they are unused.Claudio Jeker
2020-09-12Move the proc_rsync and with that the rsync processing into rsync.cClaudio Jeker
main.c is too crowded OK deraadt@
2020-09-12Delete unused strdup().tobhe
ok claudio@
2020-09-12Change the noop (-n) behaviour. When no network fetch is done thereClaudio Jeker
is no reason to run the rsync subprocess. Just immediatly make the repo valid when inserting it to the repo_list. OK benno@ (some time ago)
2020-07-31Replace warnc() with warnx() + strerror() since the first is less portable.Claudio Jeker
Should hopefully fix an issue seen by Robert Scheck OK deraadt@
2020-07-28-Separate out the adding of trust anchors into a separate function thanBob Beck
what is used for adding other certificates. -Don't call X509_verify on trust anchors for no reason. -Add basic checks for TA certificate (subject can parse, cert is not expired) -Add some useful error reporting if the TA cert we fetched is no good. ok claudio@
2020-07-28One tiny step towards adding RRDP support in rpki-client.Claudio Jeker
Extract the notify URL from the cert if it is available and pass it back to the parent process. The parent process can then use this info to load the repo via RRDP instead of rsync. OK benno@ (some long time ago)
2020-07-27Fix return value check for openssl API. Do not return success if pkey is NULL.tobhe
Feedback and ok cladio@ ok patrick@, tb@
2020-06-30Remove -f (force) option.job
The -f option existed for some initial debugging work. Thanks Weerd for review OK claudio@
2020-06-24Stop using rsync --delete when syncing up with the CA repos. InsteadClaudio Jeker
use the files referenced in the manifests to build up a list of files to keep and remove anything that is not in the list after doing the full computation. OK job@ benno@
2020-05-18Properly wait for exiting rsync processes. Since SIGCHILD is blockedClaudio Jeker
outside of ppoll() it is possible that multiple processes exited before waitpid is called. Because of this all childs need to be picked up and not only one. Fixes a hang seen more often now since there is a lot more repositories to sync. OK deraadt@ who came up with a very similar fix also OK job@ benno@
2020-05-14be little bit more verbose what went wrong in mkostempjob
2020-05-14rpki-client no longer passes -l to rsync since it does not make sense toClaudio Jeker
preserve symbolic links in the repositories. From Robert Scheck < robert at fedoraproject.org >
2020-05-06rpki-client is only interested in real files. Don't tell rsync toClaudio Jeker
preserve symbolic links. Instead just ignore them. OK benno@ deraadt@
2020-05-03Use strftime() rather than ctime() to generate timestamps nicer.Theo de Raadt
ok job, input claudio benno
2020-05-03Make it clear the date is in UTC.Theo de Raadt
ok job
2020-04-30Reword verbose log messages to clarify what's happeningjob
OK deraadt@