ERR_LIB_USER should be the last error.

Consumers sometimes use ERR_LIB_USER + <favorite number> instead of
ERR_get_next_error_library. To avoid causing them grief, keep ERR_LIB_USER
last.

Change-Id: Id19ae7836c41d5b156044bd20d417daf643bdda2
Reviewed-on: https://boringssl-review.googlesource.com/5290
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/err/err.c b/crypto/err/err.c
index f19d26b..417d322 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -512,8 +512,8 @@
     "HMAC routines",                              /* ERR_LIB_HMAC */
     "Digest functions",                           /* ERR_LIB_DIGEST */
     "Cipher functions",                           /* ERR_LIB_CIPHER */
-    "User defined functions",                     /* ERR_LIB_USER */
     "HKDF functions",                             /* ERR_LIB_HKDF */
+    "User defined functions",                     /* ERR_LIB_USER */
 };
 
 const char *ERR_lib_error_string(uint32_t packed_error) {
diff --git a/crypto/err/err_data_generate.go b/crypto/err/err_data_generate.go
index 8b1c02d..24e0d66 100644
--- a/crypto/err/err_data_generate.go
+++ b/crypto/err/err_data_generate.go
@@ -59,8 +59,8 @@
 	"HMAC",
 	"DIGEST",
 	"CIPHER",
-	"USER",
 	"HKDF",
+	"USER",
 }
 
 // stringList is a map from uint32 -> string which can output data for a sorted
diff --git a/include/openssl/err.h b/include/openssl/err.h
index bf1cf47..0a90b0e 100644
--- a/include/openssl/err.h
+++ b/include/openssl/err.h
@@ -430,8 +430,8 @@
   ERR_LIB_HMAC,
   ERR_LIB_DIGEST,
   ERR_LIB_CIPHER,
-  ERR_LIB_USER,
   ERR_LIB_HKDF,
+  ERR_LIB_USER,
   ERR_NUM_LIBS
 };