From c9dd1ec9e9debb1a20fcec9f80a0f000eca8df8e Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 27 Feb 2025 20:12:25 +0000 Subject: Hoist X509_REVOKED_cmp() above its only caller This way we don't need a prototype and things that belong together are together. Slight KNF tweak while there --- src/lib/libcrypto/asn1/x_crl.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c index c482864c72..55faeda784 100644 --- a/src/lib/libcrypto/asn1/x_crl.c +++ b/src/lib/libcrypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.46 2025/02/24 20:07:14 tb Exp $ */ +/* $OpenBSD: x_crl.c,v 1.47 2025/02/27 20:12:25 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -68,8 +68,6 @@ #include "asn1_local.h" #include "x509_local.h" -static int X509_REVOKED_cmp(const X509_REVOKED * const *a, - const X509_REVOKED * const *b); static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); static const ASN1_TEMPLATE X509_REVOKED_seq_tt[] = { @@ -101,6 +99,12 @@ const ASN1_ITEM X509_REVOKED_it = { }; LCRYPTO_ALIAS(X509_REVOKED_it); +static int +X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) +{ + return ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber); +} + /* The X509_CRL_INFO structure needs a bit of customisation. * Since we cache the original encoding the signature wont be affected by * reordering of the revoked field. @@ -516,12 +520,6 @@ X509_CRL_dup(X509_CRL *x) } LCRYPTO_ALIAS(X509_CRL_dup); -static int -X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) -{ - return(ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber)); -} - int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) { -- cgit v1.2.3-55-g6feb