1 /*
2 * Generated by util/mkerr.pl DO NOT EDIT
3 * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
4 *
5 * Licensed under the Apache License 2.0 (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
9 */
10
11 #include <openssl/err.h>
12 #include <openssl/httperr.h>
13 #include "crypto/httperr.h"
14
15 #ifndef OPENSSL_NO_HTTP
16
17 #ifndef OPENSSL_NO_ERR
18
19 static const ERR_STRING_DATA HTTP_str_reasons[] = {
20 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN),
21 "asn1 len exceeds max resp len" },
22 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_CONNECT_FAILURE), "connect failure" },
23 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_ASN1_LENGTH),
24 "error parsing asn1 length" },
25 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_CONTENT_LENGTH),
26 "error parsing content length" },
27 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_URL), "error parsing url" },
28 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_RECEIVING), "error receiving" },
29 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_SENDING), "error sending" },
30 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_FAILED_READING_DATA),
31 "failed reading data" },
32 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_HEADER_PARSE_ERROR),
33 "header parse error" },
34 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INCONSISTENT_CONTENT_LENGTH),
35 "inconsistent content length" },
36 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_PORT_NUMBER),
37 "invalid port number" },
38 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_URL_PATH), "invalid url path" },
39 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_INVALID_URL_SCHEME),
40 "invalid url scheme" },
41 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MAX_RESP_LEN_EXCEEDED),
42 "max resp len exceeded" },
43 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_ASN1_ENCODING),
44 "missing asn1 encoding" },
45 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_CONTENT_TYPE),
46 "missing content type" },
47 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_MISSING_REDIRECT_LOCATION),
48 "missing redirect location" },
49 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RECEIVED_ERROR), "received error" },
50 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RECEIVED_WRONG_HTTP_VERSION),
51 "received wrong http version" },
52 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP),
53 "redirection from https to http" },
54 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_REDIRECTION_NOT_ENABLED),
55 "redirection not enabled" },
56 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_LINE_TOO_LONG),
57 "response line too long" },
58 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_PARSE_ERROR),
59 "response parse error" },
60 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RESPONSE_TOO_MANY_HDRLINES),
61 "response too many hdrlines" },
62 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_RETRY_TIMEOUT), "retry timeout" },
63 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_SERVER_CANCELED_CONNECTION),
64 "server canceled connection" },
65 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_SOCK_NOT_SUPPORTED),
66 "sock not supported" },
67 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_STATUS_CODE_UNSUPPORTED),
68 "status code unsupported" },
69 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_TLS_NOT_ENABLED), "tls not enabled" },
70 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_TOO_MANY_REDIRECTIONS),
71 "too many redirections" },
72 { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_UNEXPECTED_CONTENT_TYPE),
73 "unexpected content type" },
74 { 0, NULL }
75 };
76
77 #endif
78
ossl_err_load_HTTP_strings(void)79 int ossl_err_load_HTTP_strings(void)
80 {
81 #ifndef OPENSSL_NO_ERR
82 if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
83 ERR_load_strings_const(HTTP_str_reasons);
84 #endif
85 return 1;
86 }
87 #else
88 NON_EMPTY_TRANSLATION_UNIT
89 #endif
90