diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-06-11 10:38:41 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-06-11 10:38:41 +0000 |
commit | 874c1a6cdaead8cc2c85796cadf473a6c5f5a13f (patch) | |
tree | d0ff7c1684f735070bcf60e60c66b01657f0775f /usr.sbin/rpki-client | |
parent | 2d136e3283fed8b40687ef31977156d743d8ec66 (diff) |
rpki-client: fix incorrect use of ASN1_tag2str()
This goes back to the initial import in mft.c and was then copied to rsc.c.
ASN1_tag2str() doesn't take a nid but rather an ASN.1 tag. Use nid2str()
instead.
ok claudio (who helped me use nid2str() correctly)
Diffstat (limited to 'usr.sbin/rpki-client')
-rw-r--r-- | usr.sbin/rpki-client/mft.c | 7 | ||||
-rw-r--r-- | usr.sbin/rpki-client/rsc.c | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/rpki-client/mft.c b/usr.sbin/rpki-client/mft.c index 46c57dbf1bf..8fa8f6ad51f 100644 --- a/usr.sbin/rpki-client/mft.c +++ b/usr.sbin/rpki-client/mft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mft.c,v 1.116 2024/05/24 12:57:20 tb Exp $ */ +/* $OpenBSD: mft.c,v 1.117 2024/06/11 10:38:40 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -366,9 +366,8 @@ mft_parse_econtent(const char *fn, struct mft *mft, const unsigned char *d, if (OBJ_obj2nid(mft_asn1->fileHashAlg) != NID_sha256) { warnx("%s: RFC 6486 section 4.2.1: fileHashAlg: " - "want SHA256 object, have %s (NID %d)", fn, - ASN1_tag2str(OBJ_obj2nid(mft_asn1->fileHashAlg)), - OBJ_obj2nid(mft_asn1->fileHashAlg)); + "want SHA256 object, have %s", fn, + nid2str(OBJ_obj2nid(mft_asn1->fileHashAlg))); goto out; } diff --git a/usr.sbin/rpki-client/rsc.c b/usr.sbin/rpki-client/rsc.c index 19dddde3631..4a849a18892 100644 --- a/usr.sbin/rpki-client/rsc.c +++ b/usr.sbin/rpki-client/rsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsc.c,v 1.34 2024/02/21 09:17:06 tb Exp $ */ +/* $OpenBSD: rsc.c,v 1.35 2024/06/11 10:38:40 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> * Copyright (c) 2022 Job Snijders <job@fastly.com> @@ -253,8 +253,8 @@ rsc_check_digesttype(const char *fn, struct rsc *rsc, const X509_ALGOR *alg) } if ((nid = OBJ_obj2nid(obj)) != NID_sha256) { - warnx("%s: RSC DigestAlgorithmIdentifier: want SHA256, have %s" - " (NID %d)", fn, ASN1_tag2str(nid), nid); + warnx("%s: RSC DigestAlgorithmIdentifier: want SHA256, have %s", + fn, nid2str(nid)); return 0; } |