summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-02-27 20:12:25 +0000
committertb <>2025-02-27 20:12:25 +0000
commitc9dd1ec9e9debb1a20fcec9f80a0f000eca8df8e (patch)
tree241b6512c22ec3024b751a0f8709370e02c31c38
parentea91fc2a6a32fa0d1e32798d42fa22b8afe3ec8e (diff)
downloadopenbsd-c9dd1ec9e9debb1a20fcec9f80a0f000eca8df8e.tar.gz
openbsd-c9dd1ec9e9debb1a20fcec9f80a0f000eca8df8e.tar.bz2
openbsd-c9dd1ec9e9debb1a20fcec9f80a0f000eca8df8e.zip
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
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c16
1 files 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 @@
1/* $OpenBSD: x_crl.c,v 1.46 2025/02/24 20:07:14 tb Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.47 2025/02/27 20:12:25 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -68,8 +68,6 @@
68#include "asn1_local.h" 68#include "asn1_local.h"
69#include "x509_local.h" 69#include "x509_local.h"
70 70
71static int X509_REVOKED_cmp(const X509_REVOKED * const *a,
72 const X509_REVOKED * const *b);
73static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); 71static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
74 72
75static const ASN1_TEMPLATE X509_REVOKED_seq_tt[] = { 73static const ASN1_TEMPLATE X509_REVOKED_seq_tt[] = {
@@ -101,6 +99,12 @@ const ASN1_ITEM X509_REVOKED_it = {
101}; 99};
102LCRYPTO_ALIAS(X509_REVOKED_it); 100LCRYPTO_ALIAS(X509_REVOKED_it);
103 101
102static int
103X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b)
104{
105 return ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber);
106}
107
104/* The X509_CRL_INFO structure needs a bit of customisation. 108/* The X509_CRL_INFO structure needs a bit of customisation.
105 * Since we cache the original encoding the signature wont be affected by 109 * Since we cache the original encoding the signature wont be affected by
106 * reordering of the revoked field. 110 * reordering of the revoked field.
@@ -516,12 +520,6 @@ X509_CRL_dup(X509_CRL *x)
516} 520}
517LCRYPTO_ALIAS(X509_CRL_dup); 521LCRYPTO_ALIAS(X509_CRL_dup);
518 522
519static int
520X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b)
521{
522 return(ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber));
523}
524
525int 523int
526X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) 524X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
527{ 525{