Skip to content

Commit f88060a

Browse files
committed
Fixed Claude code
It had hallucinated that CERT_TYPE_CONTROLLER_SIGNING has the value 3 when the correct value is 1. And it claimed that this found a cert with a subject name with "signining" in it which is incorrect. Signed-off-by: eriknordmark <erik@zededa.com>
1 parent e1acfc1 commit f88060a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/eclient/testdata/ctrl_cert_change.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ test:
7474
EDEN={{EdenConfig "eden.root"}}/{{EdenConfig "eden.bin-dist"}}/{{EdenConfig "eden.eden-bin"}}
7575
# The signing cert is no longer stored as a PEM file in /persist/certs/.
7676
# It was and is available as a JSON file in /run/zedagent/ControllerCert/.
77-
# The signing cert has Type=3 (CERT_TYPE_CONTROLLER_SIGNING) and the PEM-encoded
77+
# The signing cert has Type=1 (CERT_TYPE_CONTROLLER_SIGNING) and the PEM-encoded
7878
# cert bytes are base64-encoded in the "Cert" field.
79-
$EDEN eve ssh 'ls /run/zedagent/ControllerCert/*.json' >/tmp/files
80-
echo "Files: $(cat /tmp/files)"
79+
$EDEN eve ssh ls /run/zedagent/ControllerCert/ >/tmp/files
8180
for f in $(cat /tmp/files); do
8281
$EDEN eve ssh cat /run/zedagent/ControllerCert/$f >/tmp/$f
8382
done
8483
for f in $(cat /tmp/files); do
85-
if grep -q "\"Type\":3" "$f" 2>/dev/null; then
86-
grep -o "\"Cert\":\"[^\"]*\"" "$f" | tr -d "\"" | cut -d: -f2 | base64 -d > /tmp/server-signing-cert.pem
84+
if grep -q "\"Type\":1" "/tmp/$f" 2>/dev/null; then
85+
grep -o "\"Cert\":\"[^\"]*\"" "/tmp/$f" | tr -d "\"" | cut -d: -f2 | base64 -d > /tmp/server-signing-cert.pem
8786
break
8887
fi
8988
done

0 commit comments

Comments
 (0)