From ac23186da5d268f74aad9527b2bf5525a7b8132d Mon Sep 17 00:00:00 2001
From: jsing <>
Date: Fri, 24 Dec 2021 14:12:26 +0000
Subject: Reorder some functions.

No functional change.
---
 src/lib/libcrypto/asn1/a_string.c | 92 +++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 46 deletions(-)

(limited to 'src/lib')

diff --git a/src/lib/libcrypto/asn1/a_string.c b/src/lib/libcrypto/asn1/a_string.c
index b3a1323a54..e7e75ff9d3 100644
--- a/src/lib/libcrypto/asn1/a_string.c
+++ b/src/lib/libcrypto/asn1/a_string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_string.c,v 1.1 2021/12/15 18:00:31 jsing Exp $ */
+/* $OpenBSD: a_string.c,v 1.2 2021/12/24 14:12:26 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -63,6 +63,51 @@
 #include <openssl/buffer.h>
 #include <openssl/err.h>
 
+ASN1_STRING *
+ASN1_STRING_new(void)
+{
+	return (ASN1_STRING_type_new(V_ASN1_OCTET_STRING));
+}
+
+ASN1_STRING *
+ASN1_STRING_type_new(int type)
+{
+	ASN1_STRING *a;
+
+	if ((a = calloc(1, sizeof(ASN1_STRING))) == NULL) {
+		ASN1error(ERR_R_MALLOC_FAILURE);
+		return NULL;
+	}
+	a->type = type;
+
+	return a;
+}
+
+void
+ASN1_STRING_free(ASN1_STRING *a)
+{
+	if (a == NULL)
+		return;
+	if (a->data != NULL && !(a->flags & ASN1_STRING_FLAG_NDEF))
+		freezero(a->data, a->length);
+	free(a);
+}
+
+int
+ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
+{
+	int cmp;
+
+	if (a == NULL || b == NULL)
+		return -1;
+	if ((cmp = (a->length - b->length)) != 0)
+		return cmp;
+	if ((cmp = memcmp(a->data, b->data, a->length)) != 0)
+		return cmp;
+
+	return (a->type - b->type);
+}
+
 int
 ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str)
 {
@@ -128,51 +173,6 @@ ASN1_STRING_set0(ASN1_STRING *str, void *data, int len)
 	str->length = len;
 }
 
-ASN1_STRING *
-ASN1_STRING_new(void)
-{
-	return (ASN1_STRING_type_new(V_ASN1_OCTET_STRING));
-}
-
-ASN1_STRING *
-ASN1_STRING_type_new(int type)
-{
-	ASN1_STRING *a;
-
-	if ((a = calloc(1, sizeof(ASN1_STRING))) == NULL) {
-		ASN1error(ERR_R_MALLOC_FAILURE);
-		return NULL;
-	}
-	a->type = type;
-
-	return a;
-}
-
-void
-ASN1_STRING_free(ASN1_STRING *a)
-{
-	if (a == NULL)
-		return;
-	if (a->data != NULL && !(a->flags & ASN1_STRING_FLAG_NDEF))
-		freezero(a->data, a->length);
-	free(a);
-}
-
-int
-ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
-{
-	int cmp;
-
-	if (a == NULL || b == NULL)
-		return -1;
-	if ((cmp = (a->length - b->length)) != 0)
-		return cmp;
-	if ((cmp = memcmp(a->data, b->data, a->length)) != 0)
-		return cmp;
-
-	return (a->type - b->type);
-}
-
 void
 asn1_add_error(const unsigned char *address, int offset)
 {
-- 
cgit v1.2.3-55-g6feb