]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
fix https://github.com/acmesh-official/acme.sh/issues/3402
authorneilpang <github@neilpang.com>
Wed, 24 Feb 2021 23:45:22 +0000 (07:45 +0800)
committerneilpang <github@neilpang.com>
Wed, 24 Feb 2021 23:45:36 +0000 (07:45 +0800)
acme.sh

diff --git a/acme.sh b/acme.sh
index 3c66250edfcc14882d136da46b5fc3ecce4fef8a..24cda9c4a1fae0a29c2a270867b6d11c172f63ce 100755 (executable)
--- a/acme.sh
+++ b/acme.sh
@@ -562,8 +562,16 @@ if _exists xargs && [ "$(printf %s '\\x41' | xargs printf)" = 'A' ]; then
 fi
 
 _h2b() {
-  if _exists xxd && xxd -r -p 2>/dev/null; then
-    return
+  if _exists xxd; then
+    if _contains "$(xxd --help 2>&1)" "assumes -c30"; then
+      if xxd -r -p -c 9999 2>/dev/null; then
+        return
+      fi
+    else
+      if xxd -r -p 2>/dev/null; then
+        return
+      fi
+    fi
   fi
 
   hex=$(cat)