Sort X.509 error reasons, use next available error value, and align
authorjob <job@openbsd.org>
Mon, 24 Apr 2023 08:39:06 +0000 (08:39 +0000)
committerjob <job@openbsd.org>
Mon, 24 Apr 2023 08:39:06 +0000 (08:39 +0000)
error message with internal error code name.

OK tb@ jsing@

lib/libcrypto/x509/x509.h
lib/libcrypto/x509/x509_err.c

index e8cedaa..ece9028 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.97 2023/04/23 21:31:16 job Exp $ */
+/* $OpenBSD: x509.h,v 1.98 2023/04/24 08:39:06 job Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -1181,6 +1181,7 @@ void ERR_load_X509_strings(void);
 #define X509_R_INVALID_DIRECTORY                        113
 #define X509_R_INVALID_FIELD_NAME                       119
 #define X509_R_INVALID_TRUST                            123
+#define X509_R_INVALID_VERSION                          137
 #define X509_R_KEY_TYPE_MISMATCH                        115
 #define X509_R_KEY_VALUES_MISMATCH                      116
 #define X509_R_LOADING_CERT_DIR                                 103
@@ -1200,7 +1201,6 @@ void ERR_load_X509_strings(void);
 #define X509_R_UNSUPPORTED_ALGORITHM                    111
 #define X509_R_WRONG_LOOKUP_TYPE                        112
 #define X509_R_WRONG_TYPE                               122
-#define X509_R_INVALID_VERSION                          123
 
 #ifdef  __cplusplus
 }
index 84328df..bcb04f1 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_err.c,v 1.20 2023/04/23 21:31:16 job Exp $ */
+/* $OpenBSD: x509_err.c,v 1.21 2023/04/24 08:39:06 job Exp $ */
 /* ====================================================================
  * Copyright (c) 1999-2006 The OpenSSL Project.  All rights reserved.
  *
@@ -85,6 +85,7 @@ static ERR_STRING_DATA X509_str_reasons[] = {
        {ERR_REASON(X509_R_INVALID_DIRECTORY)    , "invalid directory"},
        {ERR_REASON(X509_R_INVALID_FIELD_NAME)   , "invalid field name"},
        {ERR_REASON(X509_R_INVALID_TRUST)        , "invalid trust"},
+       {ERR_REASON(X509_R_INVALID_VERSION)      , "invalid x509 version"},
        {ERR_REASON(X509_R_KEY_TYPE_MISMATCH)    , "key type mismatch"},
        {ERR_REASON(X509_R_KEY_VALUES_MISMATCH)  , "key values mismatch"},
        {ERR_REASON(X509_R_LOADING_CERT_DIR)     , "loading cert dir"},
@@ -104,7 +105,6 @@ static ERR_STRING_DATA X509_str_reasons[] = {
        {ERR_REASON(X509_R_UNSUPPORTED_ALGORITHM), "unsupported algorithm"},
        {ERR_REASON(X509_R_WRONG_LOOKUP_TYPE)    , "wrong lookup type"},
        {ERR_REASON(X509_R_WRONG_TYPE)           , "wrong type"},
-       {ERR_REASON(X509_R_INVALID_VERSION)      , "wrong x509 version"},
        {0, NULL}
 };