installer: suggest CDN if ftplist1 doesn't work

2023-10-25 Thread Job Snijders
Dear all, In case no mirror was previously configured (aka, this is a fresh install) and ftplist1.openbsd.org is unreachable, perhaps it's useful to suggest a default mirror to expedite the installation process. Terminal transcript on a machine that's not able to reach ftplist1, doing 'enter

Re: adjust example bgpd.conf GRACEFUL_SHUTDOWN rule

2023-09-27 Thread Job Snijders
On Wed, Sep 27, 2023 at 12:31:52PM +0200, Claudio Jeker wrote: > Graceful Shutdown should only be done on eBGP sessions. > If you alter the local-pref on ibgp sessions it is possible to produce > loops or other network instabilities. Now if all iBGP routers apply the > same rule it is fine but if

rpki-client: constraining Trust Anchors

2023-09-26 Thread Job Snijders
an 1970 00:00:00 - +++ usr.sbin/rpki-client/constraints.c 26 Sep 2023 14:27:46 - @@ -0,0 +1,584 @@ +/* $OpenBSD$ */ +/* + * Copyright (c) 2023 Job Snijders + * Copyright (c) 2023 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with o

Re: rpki-client: ensure X.509 Subject only contains commonName and serialNumber

2023-09-11 Thread Job Snijders
On Mon, Sep 11, 2023 at 09:31:03AM +0200, Theo Buehler wrote: > > - * This only parses the RFC 3779 extensions since these are necessary for > > - * validation. > > Isn't this still true? You don't really parse the subject name. I took 'parse' to mean something like 'inspects', and since it also

rpki-client: ensure X.509 Subject only contains commonName and serialNumber

2023-09-10 Thread Job Snijders
This adds another compliance check for the X.509 subject name. Only commonName, and optionally serialNumber, are permitted in the certificate subject name. See RFC 6487 section 4.4 and 4.5. It seems the one CA who was not compliant with this requirement got their act together, so now is an

rpki-client: shuffle the order in which Manifest entries are processed

2023-09-02 Thread Job Snijders
At the moment work items are enqueued in the order the CA intended them to appear on a Manifest. However, I don't see any benefit to letting third parties decide the order in which things are processed. Instead, let's randomize: ordering has no meaning anyway, and the number of concurrent

Re: rpki-client: retire log.c

2023-06-29 Thread Job Snijders
On Thu, Jun 29, 2023 at 09:30:19AM +0200, Theo Buehler wrote: > I wrote versions of this diff several times in the past but never sent > it out. A question by claudio encouraged me... > > cryptowarnx() and cryptoerrx() fail at showing openssl error stacks > in a pleasant way as no amount of

Re: rpki-client: disallow empty RFC 3779 extensions

2023-06-20 Thread Job Snijders
On Tue, Jun 20, 2023 at 10:10:43PM +0200, Theo Buehler wrote: > The first warning cannot be hit because the X509v3_asid_is_canonical() > errors on empty asIdsOrRanges sequences. This is not the case for > IPAddrBlocks... > > There is some ambiguity in RFC 6487, 4.8.10 whether empty >

Re: rpki-client: better handling of X509_get_ext_d2i() errors

2023-06-20 Thread Job Snijders
On Tue, Jun 20, 2023 at 07:50:19PM +0200, Theo Buehler wrote: > X509_get_ext_d2i() is one of those very special OpenSSL interfaces... > > It can return NULL for various reasons. If it returns NULL and crit is > not -1, something bad happened. If crit is -2, multiple extensions with > the same OID

Re: rpki-client: warn on duplicate X509v3 extensions

2023-06-20 Thread Job Snijders
On Tue, Jun 20, 2023 at 08:58:23PM +0200, Theo Buehler wrote: > For some reason libcrypto doesn't check this part of RFC 5280, 4.2: A > certificate MUST NOT include more than one instance of a particular > extension. > > With the badCertSIA2x.cer from Ties's test artefacts, I get this > warning:

reorder libssl and libtls at boot?

2023-06-16 Thread Job Snijders
Hi all, Would it be worth it to reorder libssl & libtls at boot? Kind regards, Job Index: etc/rc === RCS file: /cvs/src/etc/rc,v retrieving revision 1.571 diff -u -p -r1.571 rc --- etc/rc 26 Apr 2023 14:28:09 - 1.571

rpki-client: make ASPA AFI-agnostic

2023-06-07 Thread Job Snijders
Dear all, To simplify the concept of RPKI ASPAs, the sidrops@ group came to consensus on removing the notion of 'afiLimit'. This means that going forward, ASPA will be AFI-agnostic. Advantages to operators are that by creating just one ASPA they'll be prepared for a IPv4+IPv6 dual-stack future

rpki-client: adjust eContent version handling

2023-06-07 Thread Job Snijders
In anticipation of a bump of the ASPA eContent profile version, update valid_econtent_version() to allow for non-zero versions. OK? Kind regards, Job Index: aspa.c === RCS file: /cvs/src/usr.sbin/rpki-client/aspa.c,v retrieving

Re: rpki-client: prime file modification times to optimize failover from RRDP to RSYNC

2023-05-30 Thread Job Snijders
On Tue, May 30, 2023 at 03:12:46PM +0200, Claudio Jeker wrote: > On Tue, May 30, 2023 at 02:38:23PM +0200, Claudio Jeker wrote: > > On Wed, May 24, 2023 at 04:18:30PM +0000, Job Snijders wrote: > > > Dear all, > > > > > > Claudio made some suggestions to

Re: rpki-client: prime file modification times to optimize failover from RRDP to RSYNC

2023-05-24 Thread Job Snijders
Dear all, Claudio made some suggestions to pass the desired modification times around in a different way, below is an updated patch proposal. I also added some instrumentation to also adjust GBRs and TAKs. RIPE & APNIC informally indicated some interest in this hack. Kind regards, Job Index:

rpki-client: prime file modification times to optimize failover from RRDP to RSYNC

2023-05-19 Thread Job Snijders
Dear all, Claudio, A series of RRDP outages around the world prompted me to study whether the subsequent (perhaps even first-ever) RSYNC synchronization can be optimised for both client and rsync server. In the RSYNC protocol a file's last modification time and its size are used to determine

Re: rpki-client: provide more diagnostics to the operator

2023-05-11 Thread Job Snijders
On Thu, May 11, 2023 at 11:47:44AM +0200, Claudio Jeker wrote: > I'm not sure if this is quite right. > > valid_filehash() can be called twice first with the temp file and then > with the file from the valid repo. If the temp file has a bad hash then it > will result in a warning but the file

Re: rpki-client: provide more diagnostics to the operator

2023-05-11 Thread Job Snijders
Hi Theo, On Wed, May 10, 2023 at 09:02:13PM +0200, Theo Buehler wrote: > Again, try to keep the code as it was as far as possible. Indeed, thank you for the feedback! Below is an amended version. Kind regards, Job Index: extern.h

rpki-client: provide more diagnostics to the operator

2023-05-10 Thread Job Snijders
Hi folks, Without this changeset, rpki-client will display diagnostic information about missing files like so: $ doas rpki-client -t /etc/rpki/lacnic.tal -H repository.lacnic.net rpki-client:

Re: patch: profiling using utrace(2) (compatible with pledge and unveil)

2023-05-08 Thread Job Snijders
Hi Sebastien, Super super interesting stuff! On Tue, Apr 11, 2023 at 09:28:31AM +0200, Sebastien Marie wrote: > ## compile and collect profil information (-tu option on ktrace is optional) > $ cc -static -pg test.c > $ ktrace -di -tu ./a.out > > ## get gmon.out file > $ kdump -u gmon.out |

Re: crontab: support random offsets for steps

2023-05-03 Thread Job Snijders
An illustration of the idea, this crontab configuration: $ crontab -l | grep touch */10 * * * * touch /tmp/normal-$(date +\%s) */~10* * * * touch /tmp/mixedup-$(date +\%s) Resulted on my local machine in the following: $ ls

libcrypto: update X509_get0_signature.3 for X509_CRL_get0_tbs_sigalg

2023-03-16 Thread Job Snijders
Add man page bits for X509_CRL_get0_tbs_sigalg() OK? Index: lib/libcrypto/man/X509_get0_signature.3 === RCS file: /cvs/src/lib/libcrypto/man/X509_get0_signature.3,v retrieving revision 1.7 diff -u -p -r1.7 X509_get0_signature.3 ---

Re: rpki-client: enforce RFC7935 RSA params in outside-TBS signatures on .cer

2023-03-06 Thread Job Snijders
On Mon, Mar 06, 2023 at 10:19:36PM +, Job Snijders wrote: > Am I using X509_get_X509_PUBKEY() properly? I was not! Thanks for the clue tb@

rpki-client: enforce RFC7935 RSA params in outside-TBS signatures on .cer

2023-03-06 Thread Job Snijders
I think the newly introduced RSA parameter check valid_ca_pkey() can also be applied to the outside-TBS RSA signature in .cer files. Am I using X509_get_X509_PUBKEY() properly? OK? Kind regards, Job Index: cert.c === RCS file:

rpki-client: Enforce X509v3 SKIs to be the SHA-1 hash of the Subject Public Key

2023-03-06 Thread Job Snijders
Upon re-reading RFC 6487 section 4.8.2, SKIs are not at all arbitary identifiers: they must be the SHA-1 hash of the 'Subject Public Key'. The below changeset adds a SPK digest calculation and comparison to the X509v3 extension containing the SKI. OK? Index: x509.c

Re: rpki-client: add check for sha256WithRSAEncryption sigs on .cer and .crl files (RFC 7935)

2023-03-06 Thread Job Snijders
On Mon, Mar 06, 2023 at 04:35:05PM +0100, Theo Buehler wrote: > > 3) Signatures (outside the TBS) in a .cer must be RSA (TODO: also > > check mod + (e)) > > I'd prefer to skip this for now. This does not really buy us much, it > is independent and I see it as some polish that doesn't need to go

Re: rpki-client: add check for RSA key pair modulus & public exponent (RFC 7935)

2023-03-06 Thread Job Snijders
On Mon, Mar 06, 2023 at 12:27:36PM +0100, Theo Buehler wrote: > On Mon, Mar 06, 2023 at 10:52:31AM +0000, Job Snijders wrote: > > RFC 7935 states in section 3: "The RSA key pairs used to compute the > > signatures MUST have a 2048-bit modulus and a public expone

rpki-client: add check for RSA key pair modulus & public exponent (RFC 7935)

2023-03-06 Thread Job Snijders
Hi, RFC 7935 states in section 3: "The RSA key pairs used to compute the signatures MUST have a 2048-bit modulus and a public exponent (e) of 65,537." The below adds a check for that. OK? Kind regards, Job Index: cms.c === RCS

Re: Add the -m (--prune-empty-dirs) option to openrsync

2023-02-22 Thread Job Snijders
Dear Mohamed, On Wed, Feb 22, 2023 at 05:42:10AM +, Mohamed Bukhris wrote: > This patch adds the -m/--prume-empty-dirs option to openrsync > while keeping said feature compatible with rsync > this avoids the 27 -> 31 protocol mismatch error by not sharing the -m option > to remote > This was

Re: rpki-client: disallow trailing garbage in signed objects

2023-02-20 Thread Job Snijders
On Tue, Feb 21, 2023 at 03:07:00AM +0100, Theo Buehler wrote: > By design of d2i, it's the caller's responsibility to check a DER object > has been fully consumed. We read files from the disk, check hashes, > parse and validate the DER we encounter, but we do not make sure that > nothing follows

rpki-client: refactor parse_load_crl_from_mft()

2023-02-19 Thread Job Snijders
Hi, I wasn't entirely happy about how parse_load_crl_from_mft() behaved and refactored the function. The good: if the MFT at hand was located in DIR_TEMP and no matching CRL could be found in DIR_TEMP, it would additionally attempt to find a CRL in DIR_VALID. The bad: if the MFT at hand was

Re: openrsync: fix handling of port numbers in rsync:// urls

2023-02-14 Thread Job Snijders
Hi Theo, Thanks for the feedback, good catch on 'len'! Following your suggestions - how about the below? Kind regards, Job Index: main.c === RCS file: /cvs/src/usr.bin/rsync/main.c,v retrieving revision 1.65 diff -u -p -r1.65

openrsync: fix handling of port numbers in rsync:// urls

2023-02-12 Thread Job Snijders
I noticed there is an issue in openrsync when a port is specified in the rsync:// URL, the port number ends up becoming part of the path: $ openrsync -r rsync://rsync.roa.tohunet.com:3873/repo/ /tmp/r rsync: [sender] change_dir "/3873/repo" (in repo) failed: No such file or directory (2)

bgpd: improve RTR error handling

2023-01-31 Thread Job Snijders
When the RTR's Session ID changes (for example when the RTR server is restarted), bgpd would incorreectly branch into the "received %s: bad msg len:" path. The length fields in the RTR PDU error messages are 32-bits, so we should use ntohl() instead of ntohs(). While there, add an additional

bgpd: remove ASDOT support

2023-01-29 Thread Job Snijders
ASDOT started out as sort of a joke, but unfortunately gained some popularity in the 2010s with the rise of 4-byte ASNs and some people thinking "cute, I can write my longish number in a shorter exotic notation". Then, many operators came to realize that using a '.' (dot) in places which used to

Re: libcrypto: wrapper for internal x509v3_cache_extensions()

2023-01-20 Thread Job Snijders
On Fri, Jan 20, 2023 at 09:35:08PM +0100, Theo Buehler wrote: > On Fri, Jan 20, 2023 at 08:06:00PM +0000, Job Snijders wrote: > > While studying why X509_check_ca() is the ugly thing it is, tb@ > > suggested x509v3_cache_extensions() might benefit from a wrapper to > > avoid d

libcrypto: wrapper for internal x509v3_cache_extensions()

2023-01-20 Thread Job Snijders
While studying why X509_check_ca() is the ugly thing it is, tb@ suggested x509v3_cache_extensions() might benefit from a wrapper to avoid duplication of locking and checking the stupid EXFLAG_INVALID flag. x509v3_cache_extensions() isn't a public function anyway. Passes regress & rpki-client.

rpki-client: require version 4 UUIDs in RRDP session IDs

2023-01-18 Thread Job Snijders
All RRDP servers in the field now issue session IDs using the correct UUID version & type. OK? Kind regards, Job Index: validate.c === RCS file: /cvs/src/usr.sbin/rpki-client/validate.c,v retrieving revision 1.53 diff -u -p -r1.53

Re: sshd relinking

2023-01-16 Thread Job Snijders
On Mon, Jan 16, 2023 at 08:57:25AM -0700, Theo de Raadt wrote: > I propose to relink sshd on every boot, before it gets started. > > This is like kernel, libc.so, libcrypto, and ld.so relinking. > > The sshd design self-protects itself quite well, but this kind of > address space secrecy is

Re: rpki-client: support for authenticating signed Geofeed files (RFC 9092)

2022-11-25 Thread Job Snijders
Hi Theo, Thank you for taking the time to review this. On Fri, Nov 25, 2022 at 03:18:30PM +0100, Theo Buehler wrote: > On Fri, Nov 25, 2022 at 09:36:41AM +0000, Job Snijders wrote: > [...] > > $ ftp -MV https://sobornost.net/geofeed.csv > > Your example file contains > &g

rpki-client: support for authenticating signed Geofeed files (RFC 9092)

2022-11-25 Thread Job Snijders
= RCS file: geofeed.c diff -N geofeed.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ geofeed.c 25 Nov 2022 09:26:11 - @@ -0,0 +1,233 @@ +/* $OpenBSD: geofeed.c,v 1.18 2022/11/02 12:46:49 job Exp $ */ +/* + * Copyright (c) 2022 Job Snijder

rpki-client: fold -T (bird table name) into -B (bird output)

2022-11-17 Thread Job Snijders
I don't think I've ever heard anyone use the '-T' feature. Perhaps better to fold it into '-B' (BIRD output) using getopt '::' trick? I don't feel super strong about this, but it helps reclaim a getopt letter. Kind regards, Job Index: main.c

Re: rpki-client: add 'shortlist' functionality

2022-11-17 Thread Job Snijders
Heya! On Thu, Nov 17, 2022 at 08:39:36PM +0100, Theo Buehler wrote: > > This functionality is handy if you want to inspect only specific > > repositories and ignore the rest of the world. Useful for monitoring > > too. > > > > OK? Feedback? > > I have no objection code-wise and I understand the

rpki-client: add 'shortlist' functionality

2022-11-17 Thread Job Snijders
Dear all, I introduced a 'shortlist' feature in rpki-client(8). If the operator specifies one or more '-q' options followed by FQDNs, the utility will *only* connect to those hosts and skip all others. $ doas rpki-client -q rpki.ripe.net -q chloe.sobornost.net Processing time 84 seconds

Re: bgpd: add base support for ASPA

2022-11-16 Thread Job Snijders
On Wed, Nov 16, 2022 at 02:43:40PM +0100, Claudio Jeker wrote: > On Wed, Nov 16, 2022 at 12:18:14PM +0000, Job Snijders wrote: > > On Wed, Nov 16, 2022 at 12:47:46PM +0100, Claudio Jeker wrote: > > > A aspa-set is defined like this: > > > aspa-set { > > >

Re: bgpd: add base support for ASPA

2022-11-16 Thread Job Snijders
On Wed, Nov 16, 2022 at 12:47:46PM +0100, Claudio Jeker wrote: > A aspa-set is defined like this: > aspa-set { > source-as 1 transit-as { 5 } > source-as 2 expires 1668181648 transit-as { 3 4 } > source-as 5 transit-as { 1 2 allow inet 7 allow inet6 } > } bikeshed.com I'd

rpki-client: error out if too many ipAddrBlocks in ROA payload

2022-11-09 Thread Job Snijders
Hi all, The ASN.1 profile in draft-ietf-sidrops-rfc6482bis section 4 https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-rfc6482bis-01 specifies that there must not be more than 2 ipAddrBlocks (one for IPv4, and one for IPv6). This changeset enforces that constraint. Compatible with all

ssh-keygen(1): by default generate ed25519 key (instead of rsa)

2022-11-06 Thread Job Snijders
Dear all, Support for using Ed25519 for server and user authentication was introduced in 2014. I like the compactness of Ed25519 public keys. Perhaps now is a good time to make Ed25519 the default key type when invoking ssh-keygen(1) without arguments? Kind regards, Job Index: ssh-keygen.1

rpki-client: check SIA signedObject on ASPA/MFT/ROA/GBR/TAK

2022-11-03 Thread Job Snijders
Hi all, RFC 6487 section 4.8.8.2 mandates that the SIA extension must be present, and contain *at least* an instance of accessMethod id-ad-signedObject. The below changeset enforces this requirement. OK? Index: aspa.c === RCS file:

rpki-client: print IP when connection times out

2022-11-01 Thread Job Snijders
It can be useful to see a little bit more detail on what exactly isn't working. OK? Index: http.c === RCS file: /cvs/src/usr.sbin/rpki-client/http.c,v retrieving revision 1.70 diff -u -p -r1.70 http.c --- http.c 18 Oct 2022

Re: rpki-client: make x509_init_oid() table-based?

2022-10-24 Thread Job Snijders
On Mon, Oct 24, 2022 at 11:58:50AM +0200, Theo Buehler wrote: > The amount of copy-paste and repetition in x509_init_oid() is becoming > a bit much. The function is an eyesore due to the repetition and made > worse by the inconsistent wrapping. It's long past the point where my > brain is still

rpki-client: add support for draft-ietf-sidrops-signed-tal-12

2022-10-21 Thread Job Snijders
12 +RPKI Signed Object for Trust Anchor Key. .El .Sh HISTORY .Nm Index: rsync.c === RCS file: /cvs/src/usr.sbin/rpki-client/rsync.c,v retrieving revision 1.43 diff -u -p -r1.43 rsync.c --- rsync.c 2 Sep 2022 17:39:51 -

rpki-client: ASN1_IMP_OPT vs ASN1_EXP_OPT

2022-10-12 Thread Job Snijders
Hi all, All of ROA, MFT, ASPA, and RSC define their respective 'version' field in ASN.1 as following: version [0] INTEGER DEFAULT 0, Each object profile preamble "DEFINITIONS EXPLICIT TAGS ::=" We haven't bumped into an issue yet, because all Signed Objects are at version 0, which means

wc(1): add -L flag to write length of longest line

2022-09-29 Thread Job Snijders
Hi all, I often find myself piping data through ... | awk '{print length}' | ... I figured there should be a more direct way that requires less typing. Perhaps other developers have a similar itch? The FreeBSD, NetBSD, Dragonfly, and GNU variants of the wc(1) utility have a similar -L feature.

ps: fix incorrect trimming

2022-09-20 Thread Job Snijders
Christian Weisgerber reported the new 'f' feature in ps(1) does not apply line length trimming correctly. The problem can be observed when comparing '$ COLUMNS=79 ps l' and '$ COLUMNS=79 ps lf' OK? Index: print.c === RCS file:

libcrypto: add OID for RPKI signedTAL objects

2022-09-15 Thread Job Snijders
IANA made a permanent registration in the SMI Security for S/MIME CMS Content Type registry at https://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml#security-smime-1 for signed objects conforming to draft-ietf-sidrops-signed-tal. OK? Kind regards, Job Index:

Re: rpki-client: fully reset provider for each providerAS

2022-09-05 Thread Job Snijders
On Mon, Sep 05, 2022 at 02:46:45PM +0200, Theo Buehler wrote: > Once a ProviderAS has an afiLimit, all subsequent ProviderAS without > afiLimit will erroneously inherit that limit since provider.afi is > only (re)set if pa->afiLimit != NULL. Zeroing the provider inside the > loop avoids this

Re: rpki-client: fix todo item about freeing in parser process

2022-09-03 Thread Job Snijders
On Sat, Sep 03, 2022 at 08:42:53PM +, Job Snijders wrote: > Found a small todo item in proc_parser() to free the entries in the auth > and crl trees. Reworked the diff to retain RB_GENERATE_STATIC() scope OK? Index:

rpki-client: fix todo item about freeing in parser process

2022-09-03 Thread Job Snijders
Found a small todo item in proc_parser() to free the entries in the auth and crl trees. OK? Kind regards, Job Index: cert.c === RCS file: /cvs/src/usr.sbin/rpki-client/cert.c,v retrieving revision 1.88 diff -u -p -r1.88 cert.c ---

rpki-client: check inherit constraint on TAs earlier on

2022-09-03 Thread Job Snijders
RPKI Trust Anchors (self-signed root certificates) MAY NOT contain 'inherit' elements in their RFC 3779 resource extensions according to RFC 6490 section 2.2. We could check way earlier on in the validation process whether the TA certificate conforms to this constraint. The below changeset moves

Re: rpki-client include "parent" repo id in certs

2022-09-03 Thread Job Snijders
On Sat, Sep 03, 2022 at 01:27:03PM +0200, Theo Buehler wrote: > On Sat, Sep 03, 2022 at 01:18:13PM +0200, Claudio Jeker wrote: > > This diff adds the parentid to struct cert. The parentid is the id of the > > repository the cert lives in. This information will be used to track the > > parent

Re: rpki-client stop all repo fetching a bit before the timeout

2022-09-02 Thread Job Snijders
Hi Claudio, This looks mostly OK, just a few nit: On Fri, Sep 02, 2022 at 10:02:33PM +0200, Claudio Jeker wrote: > @@ -1223,8 +1224,26 @@ repo_check_timeout(int timeout) > { > struct repo *rp; > time_t now; > + int diff; > > now =

Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Job Snijders
On Thu, Sep 01, 2022 at 06:14:17PM +0200, Florian Obser wrote: > >> NetBSD's and FreeBSD's ps(1) use '-d' to display process hierarchy. > > > > using -f would follow the path of least resistance. Is there really a > > common > > user commnity between freebsd netbsd and openbsd? I doubt it. > >

Re: ps(1): add -d (descendancy) option to display parent/child process relationships

2022-09-01 Thread Job Snijders
On Thu, Sep 01, 2022 at 03:14:40PM +0200, Martin Schröder wrote: > Am Do., 1. Sept. 2022 um 05:38 Uhr schrieb Job Snijders : > > Some ps(1) implementations have an '-d' ('descendancy') option. Through > > ASCII art parent/child process relationships are grouped and displayed. &

ps(1): add -d (descendancy) option to display parent/child process relationships

2022-08-31 Thread Job Snijders
Dear all, Some ps(1) implementations have an '-d' ('descendancy') option. Through ASCII art parent/child process relationships are grouped and displayed. Here is an example: $ ps ad -O ppid,user PID PPID USER TT STATTIME COMMAND 18180 12529 job pb I+p

Re: rpki-client: print info about encapsulated certs & PEM format in filemode

2022-08-25 Thread Job Snijders
On Thu, Aug 25, 2022 at 06:38:36PM +0200, Theo Buehler wrote: > On Thu, Aug 25, 2022 at 04:04:27PM +0000, Job Snijders wrote: > > On Thu, Aug 25, 2022 at 03:38:45PM +0200, Claudio Jeker wrote: > > > I wonder why is PEM printing not part of -f? It seems to be something > &g

Re: rpki-client: print info about encapsulated certs & PEM format in filemode

2022-08-25 Thread Job Snijders
On Thu, Aug 25, 2022 at 03:38:45PM +0200, Claudio Jeker wrote: > I wonder why is PEM printing not part of -f? It seems to be something > that should be part of filemode. OK, how about this? Kind regards, Job Index: filemode.c ===

Re: rpki-client: add mode to print encapsulated certs/crls in human-readable & PEM format

2022-08-25 Thread Job Snijders
= RCS file: /cvs/src/usr.sbin/rpki-client/print.c,v retrieving revision 1.14 diff -u -p -r1.14 print.c --- print.c 14 Jul 2022 13:24:56 - 1.14 +++ print.c 25 Aug 2022 13:00:27 - @@ -1,5 +1,6 @@ /* $OpenBSD: print.c,v 1.14 2022/07/14 13:24:56 job Exp $

rpki-client: add mode to print encapsulated certs/crls in human-readable & PEM format

2022-08-24 Thread Job Snijders
print.c --- print.c 14 Jul 2022 13:24:56 - 1.14 +++ print.c 24 Aug 2022 23:33:25 - @@ -1,5 +1,6 @@ /* $OpenBSD: print.c,v 1.14 2022/07/14 13:24:56 job Exp $ */ /* + * Copyright (c) 2022 Job Snijders * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons

Re: rpki-client: retire valid_cert()

2022-08-22 Thread Job Snijders
On Mon, Aug 22, 2022 at 12:14:53PM +0200, Theo Buehler wrote: > rpki-client portable makes sure that libcrypto has RFC 3779 support. > Therefore the X509_verify_cert() call in valid_x509() will already > perform the checks that the RFC 3779 extensions are covered along the > chain. While

Re: rpki-client: disallow inherit in ROA EE IP Resources extension

2022-08-18 Thread Job Snijders
On Sat, Aug 13, 2022 at 04:51:05PM +0200, Theo Buehler wrote: > job mentioned that it might be preferable to do the validation in > parse_{roa,rsc,aspa}(). So here's a diff that does this. It reworks > valid_{roa,rsc}() to compare only against the EE cert's resources > since it doesn't really make

rpki-client: add ASPA profile-10 support

2022-08-12 Thread Job Snijders
ex: aspa.c === RCS file: aspa.c diff -N aspa.c --- /dev/null 1 Jan 1970 00:00:00 - +++ aspa.c 13 Aug 2022 00:24:24 - @@ -0,0 +1,447 @@ +/* $OpenBSD: aspa.c,v 1.16 2022/05/11 21:19:06 job Exp $ */ +/* + * Copyright (c) 2022 Jo

Re: rpki-client: disallow inherit in ROA EE IP Resources extension

2022-08-10 Thread Job Snijders
On Wed, Aug 10, 2022 at 06:16:30PM +0200, Theo Buehler wrote: > On Wed, Aug 10, 2022 at 03:10:19PM +0000, Job Snijders wrote: > > An errata exists for RFC 6482, which informs us: """The EE certificate > > MUST NOT use "inherit" elements as described in [RF

rpki-client: disallow inherit in ROA EE IP Resources extension

2022-08-10 Thread Job Snijders
Hi all, An errata exists for RFC 6482, which informs us: """The EE certificate MUST NOT use "inherit" elements as described in [RFC3779].""" Read the full report here: https://www.rfc-editor.org/errata/eid3166 Although it might seem a bit 'wasteful' to d2i the IP Resources extension in multiple

rpki-client: tighten ROA parsing by forbidding AS Resources extension on the EE

2022-08-10 Thread Job Snijders
Hi, The ROA specification (RFC 6482 § 4) is a bit underspecified, but 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. I've seen it happen once, in the past, which was a CA mistake. Related reading

rpki-client: decrease how long to wait for the remote peer to send IO

2022-08-09 Thread Job Snijders
Dear all, I like to run rpki-client very often, and not be bogged down with non-responsive respositories. If a repository is uncommunicative, rpki-client as-is will try other transports, or come back later (because of a next crontab invocation). In rpki-client, RSYNC & HTTPS timeouts now are

Re: rpki-client: add connect() MAX_CONTIMEOUT for rsync/rrdp

2022-08-08 Thread Job Snijders
On Tue, Aug 02, 2022 at 12:27:57PM -0600, Theo de Raadt wrote: > I think you intend for that to be two seperate diffs, not merged into > one. > > For connect < 15 seconds, I think that is a bit strict. > > For IO stalling 15 seconds, I suspect such IO stalls happen more than > we know, and will

Re: rpki-client: add connect() MAX_CONTIMEOUT for rsync/rrdp

2022-08-03 Thread Job Snijders
On Tue, Aug 02, 2022 at 12:27:57PM -0600, Theo de Raadt wrote: > I don't see any way this can be tested in less than 24 hours. Good idea. I've set up a fast testrig that runs two instances in parallel in a 'while true' loop (with and without the changeset), each with their own cachedir on MFS.

Re: rpki-client: add connect() MAX_CONTIMEOUT for rsync/rrdp

2022-08-02 Thread Job Snijders
On Tue, Aug 02, 2022 at 03:59:40PM +0200, Claudio Jeker wrote: > What makes you think that 15sec is enough to open connections in all > scenarios? I feel this is one of those changes that just shows that > maybe the current connect timeout from the system is too conservative. Yeah, maybe. How

Re: openrsync: add --contimeout

2022-08-02 Thread Job Snijders
On Tue, Aug 02, 2022 at 04:15:39PM +0200, Claudio Jeker wrote: > On Tue, Aug 02, 2022 at 12:42:26PM +0000, Job Snijders wrote: > > This adds '--contimeout' to rsync(1) > > > > $ time openrsync --contimeout=5 -rt rsync://203.119.21.1/test /tmp/k > > openrsyn

rpki-client: add connect() MAX_CONTIMEOUT for rsync/rrdp

2022-08-02 Thread Job Snijders
Hi, We were doing a lot of waiting in connect() for some (currently) broken repositories. Move on with life after MAX_CONTIMEOUT seconds. This changeset reduces the real time spent fetching the RIPE TAL (with hot cache) from 7m14.57s to 3m20.10s on an IPv4+IPv6 dual-stacked host. This changeset

openrsync: add --contimeout

2022-08-02 Thread Job Snijders
Hi all, This adds '--contimeout' to rsync(1) $ time openrsync --contimeout=5 -rt rsync://203.119.21.1/test /tmp/k openrsync: warning: connect timeout: 203.119.21.1, 203.119.21.1 openrsync: error: cannot connect to host: 203.119.21.1 0m05.01s real 0m00.00s user 0m00.01s system OK?

Re: ts(1): make timespec-handling code more obvious

2022-07-05 Thread Job Snijders
> > this changeset too. > > Ah right, we print us not ms. > > > nitpick: the changeset doesn't apply cleanly: > > Forgot to update that tree :) > > Updated diff below OK job@

Re: ts(1): make timespec-handling code more obvious

2022-07-05 Thread Job Snijders
On Tue, Jul 05, 2022 at 11:08:13AM +0200, Claudio Jeker wrote: > On Mon, Jul 04, 2022 at 05:10:05PM -0500, Scott Cheloha wrote: > > On Mon, Jul 04, 2022 at 11:15:24PM +0200, Claudio Jeker wrote: > > > On Mon, Jul 04, 2022 at 01:28:12PM -0500, Scott Cheloha wrote: > > > > Hi, > > > > > > > >

Re: Import ts(1) - a timestamp utility

2022-06-29 Thread Job Snijders
On Wed, Jun 29, 2022 at 07:34:08PM +0100, Jason McIntyre wrote: > On Wed, Jun 29, 2022 at 08:27:54PM +0200, Leon Fischer wrote: > > > The below changeset is a from scratch & pledged C implementation of the > > > 'ts' perl utility found in the moreutils collection by Joey Hess. > > > > Hi, a few

Re: Import ts(1) - a timestamp utility

2022-06-29 Thread Job Snijders
On Wed, Jun 29, 2022 at 09:18:08AM +, Job Snijders wrote: > Add a '-m' monotonic clock option I misunderstood what the moreutils ts -m option was doing, below is a different version, which is 'resistant' against the wallclock jump back and forth. Index: t

Re: Import ts(1) - a timestamp utility

2022-06-29 Thread Job Snijders
Hi all, Add a '-m' monotonic clock option Index: ts.1 === RCS file: /cvs/src/usr.bin/ts/ts.1,v retrieving revision 1.1 diff -u -p -r1.1 ts.1 --- ts.129 Jun 2022 08:39:49 - 1.1 +++ ts.129 Jun 2022 09:15:29

Import ts(1) - a timestamp utility

2022-06-28 Thread Job Snijders
ts.1 === RCS file: ts/ts.1 diff -N ts/ts.1 --- /dev/null 1 Jan 1970 00:00:00 - +++ ts/ts.1 28 Jun 2022 22:32:32 - @@ -0,0 +1,93 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 2022 Job Snijders +.\" +.\" Permission to use, copy, modify, and distribute this

Re: rpki-client: limit number of RSC checklist entries?

2022-06-01 Thread Job Snijders
On Wed, Jun 01, 2022 at 09:09:35AM +0200, Claudio Jeker wrote: > On Wed, Jun 01, 2022 at 08:44:43AM +0200, Theo Buehler wrote: > > When compared to manifest FileAndHash, the RSC code doesn't limit > > the size of the FileNameAndHash list. Should we do this for > > consistency? > > > > The

Re: rpki-client: implement rsc-08.txt with templates

2022-05-31 Thread Job Snijders
On Tue, May 31, 2022 at 04:16:20PM +0200, Claudio Jeker wrote: > On Tue, May 31, 2022 at 01:16:19PM +0200, Theo Buehler wrote: > > I chose to implement the constrained versions of the RFC 3779 types from > > the draft because the OpenSSL RFC 3779 code has static IPAddrBlocks_it, > > so we have to

tcpdump: add RFC9234 "BGP Role" support

2022-05-24 Thread Job Snijders
Hi all, I based this off reading https://datatracker.ietf.org/doc/html/rfc9234 This code is untested! I haven't had a chance yet to tcpdump a RFC 9234 capable BGP speaker. There might be some out there, according to https://trac.ietf.org/trac/idr/wiki/draft-ietf-idr-bgp-open-policy Kind

rpki-client: consider CA:FALSE certs to be invalid

2022-05-10 Thread Job Snijders
Hi, Following this errata report https://www.rfc-editor.org/errata/eid6854 If the Basic Constraints extension is present, and the certificate is *not* a CA - as determined by X509_check_ca(3), leave the purpose as CERT_PURPOSE_INVALID. While there, use the value name rather than 0. OK? Kind

Re: rpki-client: add support for draft-ietf-sidrops-rpki-rsc in filemode

2022-05-09 Thread Job Snijders
On Mon, May 09, 2022 at 05:08:53PM +0200, Theo Buehler wrote: > On Mon, May 09, 2022 at 02:59:06PM +0200, Claudio Jeker wrote: > > On Mon, May 09, 2022 at 12:53:05PM +0200, Theo Buehler wrote: > > > Regarding the spec: > > > > > > * isn't it a bit unfortunate that the ResourceBlock contains an >

Re: rpki-client: add support for draft-ietf-sidrops-rpki-rsc in filemode

2022-05-09 Thread Job Snijders
+ } + + if (outformats & FORMAT_JSON) + printf("\t],\n"); +} Index: usr.sbin/rpki-client/rpki-client.8 ======= RCS file: /cvs/src/usr.sbin/rpki-client/rpki-client.8,v retrieving revision 1.61 diff -

Re: rpki-client: add support for draft-ietf-sidrops-rpki-rsc in filemode

2022-05-08 Thread Job Snijders
hash); + } + + if (outformats & FORMAT_JSON) + printf("\t],\n"); +} Index: usr.sbin/rpki-client/rpki-client.8 === RCS file: /cvs/src/usr.sbin/rpki-client/rpki-client.8,v retrieving revision 1

rpki-client: add support for draft-ietf-sidrops-rpki-rsc in filemode

2022-05-08 Thread Job Snijders
les[i].filename : "no filename"); + printf("\thash %s\n", hash); + } + + free(hash); + } + + if (outformats & FORMAT_JSON) + printf("\t],\n"); +} Index: usr.sbin/rpki-client/rpki-client.

rpki-client: emit object hash identifier in filemode

2022-04-23 Thread Job Snijders
Hi all, Since certificate mallebility no longer is a problem in the RPKI ecosystem ... the SHA256 digest of a RPKI signed object input file is a very stable identifier to associate to the decoded (validated) output from filemode! Example: $ rpki-client -j -f rZWj66_V88W5B41mgMEm-TNr_EU.roa

Re: rpki-client: extend -f to print TAL details

2022-04-11 Thread Job Snijders
On Mon, Apr 11, 2022 at 06:46:20PM +0200, Theo Buehler wrote: > Is this base64 blob really useful? The exact same thing is contained in > a more readable fashion (i.e. with line breaks) in the .tal file itself. OK, cat(1) can also be used indeed :-) > Apart from that, I'm fine with having

rpki-client: extend -f to print TAL details

2022-04-11 Thread Job Snijders
Hi, This changeset extends rpki-client to print more detail encapsulated inside TAL files, of specific interest is printing the Subject Key Identifier (SKI) of the Trust Anchor you'd find if you download the referenced .cer file. The SPKI is printed as base64 encoded DER. Example: $

Re: rpki-client MFT file and hash check change

2022-01-24 Thread Job Snijders
On Mon, Jan 24, 2022 at 06:50:51PM +0100, Claudio Jeker wrote: > > Requiring any content to be present (and the file's calculated digest to > > match with the hash listed on the Manifest) might pose a problem with > > our --exclude/--include rsync filter: files of unknown type are not > >

  1   2   3   >