diff options
author | Richard Levitte <levitte@openssl.org> | 2020-08-16 21:22:02 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-08-21 09:23:58 +0200 |
commit | f650993f1de3dbb5eda9009ad0c4895a7b1b7fe2 (patch) | |
tree | 297d28f667f1d9bd563fd728a0690b3b32196492 | |
parent | Add libctx/provider support to cmp_msg_test (diff) | |
download | openssl-f650993f1de3dbb5eda9009ad0c4895a7b1b7fe2.tar.xz openssl-f650993f1de3dbb5eda9009ad0c4895a7b1b7fe2.zip |
Rename OSSL_SERIALIZER / OSSL_DESERIALIZER to OSSL_ENCODE / OSSL_DECODE
These are the scripts that do the deed.
Fixes #12455
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12660)
-rwxr-xr-x | util/rename-serdes.sh | 113 | ||||
-rwxr-xr-x | util/reset_serdes.sh | 5 |
2 files changed, 118 insertions, 0 deletions
diff --git a/util/rename-serdes.sh b/util/rename-serdes.sh new file mode 100755 index 0000000000..304be50b0f --- /dev/null +++ b/util/rename-serdes.sh @@ -0,0 +1,113 @@ +#! /bin/bash + +# Move directories and adjust the parent build.info +git mv crypto/serializer crypto/encode_decode +git mv providers/implementations/serializers \ + providers/implementations/encode_decode +sed -i \ + -e 's|serializers|encode_decode|' \ + -e 's|serializer|encode_decode|' \ + crypto/build.info providers/implementations/build.info + +# Rename files and adjust build.info in the same directory +git ls-files \ + crypto/encode_decode \ + include/crypto/serializer.h \ + include/openssl/{de,}serializer* \ + providers/implementations/encode_decode \ + providers \ + doc/man3 \ + doc/man7 \ + test \ + | while read filename; do + new_filename=$(echo "$filename" \ + | sed -e 's/OSSL_DESERIALIZE/OSSL_DECODE/g' \ + -e 's/deserialize/decode/g' \ + -e 's/OSSL_SERIALIZE/OSSL_ENCODE/g' \ + -e 's/serialize/encode/g' \ + -e 's/serdes/endecode/g' ) + [ "$filename" = "$new_filename" ] || git mv "$filename" "$new_filename" +done +sed -i \ + -e 's/DESERIALIZE/DECODE/g' \ + -e 's/deserialize/decode/g' \ + -e 's/SERIALIZE/ENCODE/g' \ + -e 's/serialize/encode/g' \ + -e 's/serdes/endecode/g' \ + crypto/encode_decode/build.info \ + providers/implementations/encode_decode/build.info \ + test/build.info \ + test/recipes/04-test_encoder_decoder.t +git add -u + +# Big source rename +# (additional files in sed command aren't caught by the big grep) +git grep -l -E 'OSSL_(OP_|FUNC_)?(DE)?SERIALIZER' \ + | xargs perl -p -i \ + -e 's/DESERIALIZE/DECODE/g;' \ + -e 's/Deserialize/Decode/g;' \ + -e 's/deserialize/decode/g;' \ + -e 's/Deserializing/Decoding/g;' \ + -e 's/deserializing/decoding/g;' \ + -e 's/Deserialization/Decoding/g;' \ + -e 's/deserialization/decoding/g;' \ + -e 's/\bDESER(_|\b)/DECODER$1/g;' \ + -e 's/\bdeser(_|\b)/decoder$1/g;' \ + -e 's/SERIALIZE/ENCODE/g;' \ + -e 's/Serialize/Encode/g;' \ + -e 's/serialize/encode/g;' \ + -e 's/Serializing/Encoding/g;' \ + -e 's/serializing/encoding/g;' \ + -e 's/Serialization/Encoding/g;' \ + -e 's/serialization/encoding/g;' \ + -e 's/\bSER(_|\b)/ENCODER$1/g;' \ + -e 's/\bser(_|\b)/encoder$1/g;' \ + -e 's/\bserprop\b/encprop/g;' \ + -e 's/\bsctx\b/ectx/g;' \ + crypto/property/property_parse.c \ + doc/man1/openssl-list.pod.in \ + doc/man7/OSSL_PROVIDER-FIPS.pod \ + doc/man7/provider*.pod \ + include/internal/cryptlib.h \ + providers/*.inc \ + providers/implementations/encode_decode/*.[ch] \ + providers/implementations/include/prov/implementations.h + +# Remove unnecessary inclusions (if they were necessary, the Big API rename +# would have renamed them properly +git grep -l -E '<openssl/(de)?serializer\.h>' \ + | xargs sed -E -i \ + -e '/<openssl\/(de)?serializer\.h>/d' + +# Adjust a few files that have columns +cat crypto/err/openssl.ec | while read line; do + ( + set -- $line + if [ "$1" = "L" ]; then + printf "L %-13s %-31s %s\n" $2 $3 $4 + else + echo "$line" + fi + ) +done > crypto/err/openssl.ec.new +mv crypto/err/openssl.ec.new crypto/err/openssl.ec + +cat util/libcrypto.num | while read sym num version info; do + printf '%-39s %s\t%s\t%s\n' "$sym" "$num" "$version" "$info" +done > util/libcrypto.num.new +mv util/libcrypto.num.new util/libcrypto.num + +cat util/other.syms | while read sym rest; do + if [ "$sym" = "#" ]; then + if [ -n "$rest" ]; then + echo "$sym $rest" + else + echo "$sym" + fi + else + printf '%-39s %s\n' "$sym" "$rest" + fi +done > util/other.syms.new +mv util/other.syms.new util/other.syms + +git add -u diff --git a/util/reset_serdes.sh b/util/reset_serdes.sh new file mode 100755 index 0000000000..506b8590bb --- /dev/null +++ b/util/reset_serdes.sh @@ -0,0 +1,5 @@ +#! /bin/sh + +git restore --staged . +git restore . +git clean -f crypto doc include providers test |