]> git.ipfire.org Git - thirdparty/openssl.git/blame - util/err-to-raise
Generalize the HTTP client so far implemented mostly in crypto/ocsp/ocsp_ht.c
[thirdparty/openssl.git] / util / err-to-raise
CommitLineData
0f17ac26
RS
1#! /usr/bin/env perl
2# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3#
4# Licensed under the Apache License 2.0 (the "License"). You may not use
5# this file except in compliance with the License. You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9# Run this program like this:
10# perl -pi util/err-to-error files...
11# or
12# git ls-files | grep '\.c$' | xargs perl -pi util/err-to-raise
8c0e7681
RS
13# Consider running util/merge-err-lines first, to catch most (all?) of the
14# cases where the XXXerr() call is split into two lines.
f6aca23e
RS
15
16# Also, what to do about the engines files? This includes:
17# AFALGerr, CAPIerr, DASYNC, OSSLTEST
18# There are about 70 such lines.
0f17ac26
RS
19
20use strict;
21use warnings;
22
f6aca23e
RS
23s/ASN1err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ASN1, $1)/;
24s/([^D])ASYNCerr\(\w+, *(\w+)\)/$1ERR_raise(ERR_LIB_ASYNC, $2)/;
25s/BIOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BIO, $1)/;
26s/BNerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BN, $1)/;
27s/BUFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BUF, $1)/;
28s/CMPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CMP, $1)/;
29s/CMSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CMS, $1)/;
30s/COMPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_COMP, $1)/;
31s/CONFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CONF, $1)/;
32s/CRMFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CRMF, $1)/;
33s/CRYPTOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CRYPTO, $1)/;
34s/CTerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CT, $1)/;
35s/DHerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DH, $1)/;
36s/DSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DSA, $1)/;
37s/DSOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DSO, $1)/;
38s/ECDHerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ECDH, $1)/;
39s/ECDSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ECDSA, $1)/;
40s/ECerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_EC, $1)/;
41s/ENGINEerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ENGINE, $1)/;
42s/ESSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ESS, $1)/;
43s/EVPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_EVP, $1)/;
44s/FIPSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_FIPS, $1)/;
29f178bd 45s/HTTPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_HTTP, $1)/;
f6aca23e
RS
46s/KDFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_KDF, $1)/;
47s/OBJerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OBJ, $1)/;
48s/OCSPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OCSP, $1)/;
49s/OSSL_STOREerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OSSL_STORE, $1)/;
50s/PEMerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PEM, $1)/;
51s/PKCS12err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PKCS12, $1)/;
52s/PKCS7err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PKCS7, $1)/;
53s/PROPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PROP, $1)/;
54s/PROVerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PROV, $1)/;
55s/RANDerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_RAND, $1)/;
56s/RSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_RSA, $1)/;
57s/SM2err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SM2, $1)/;
58s/SSLerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SSL, $1)/;
59s/SYSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SYS, $1)/;
60s/TSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_TS, $1)/;
61s/UIerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_UI, $1)/;
62s/X509V3err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_X509V3, $1)/;
63s/X509err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_X509, $1)/;