Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Do not add newlines when encoding DER certificates in base64
Browse files Browse the repository at this point in the history
  • Loading branch information
babelouest committed Jan 25, 2024
1 parent d567f6e commit 2f04d2e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/cert/create-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ else
printf "user1.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/user1.crt --outder | base64 > $DEST/user1.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/user1.crt --outder | base64 -w0 > $DEST/user1.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "user1.crt.der \033[0;32mOK\033[0m\n"
Expand All @@ -114,7 +114,7 @@ else
printf "user2.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/user2.crt --outder | base64 > $DEST/user2.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/user2.crt --outder | base64 -w0 > $DEST/user2.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "user2.crt.der \033[0;32mOK\033[0m\n"
Expand Down Expand Up @@ -158,7 +158,7 @@ else
printf "user3.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/user3.crt --outder | base64 > $DEST/user3.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/user3.crt --outder | base64 -w0 > $DEST/user3.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "user3.crt.der \033[0;32mOK\033[0m\n"
Expand Down Expand Up @@ -346,7 +346,7 @@ else
printf "client1.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/client1.crt --outder | base64 > $DEST/client1.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/client1.crt --outder | base64 -w0 > $DEST/client1.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "client1.crt.der \033[0;32mOK\033[0m\n"
Expand All @@ -372,7 +372,7 @@ else
printf "client2.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/client2.crt --outder | base64 > $DEST/client2.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/client2.crt --outder | base64 -w0 > $DEST/client2.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "client2.crt.der \033[0;32mOK\033[0m\n"
Expand All @@ -398,7 +398,7 @@ else
printf "client3.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/client3.crt --outder | base64 > $DEST/client3.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/client3.crt --outder | base64 -w0 > $DEST/client3.crt.der 2>>$DEST/certtool.log
STATUS=$?
if [ $STATUS -eq 0 ]; then
printf "client3.crt.der \033[0;32mOK\033[0m\n"
Expand Down Expand Up @@ -442,7 +442,7 @@ else
printf "apple-int.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 -w0 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log

# CA intermediate 2 apple
$CERTTOOL --generate-privkey --outfile $DEST/apple-int2.key $ECDSA --sec-param High 2>>$DEST/certtool.log
Expand All @@ -461,7 +461,7 @@ else
printf "apple-int2.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 -w0 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log

# CA apple 2
$CERTTOOL --generate-privkey --outfile $DEST/apple2.key $ECDSA --sec-param High 2>>$DEST/certtool.log
Expand Down Expand Up @@ -498,6 +498,6 @@ else
printf "apple2-int.crt \033[0;31mError\033[0m\n"
RET=$STATUS
fi
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log
$CERTTOOL --certificate-info --infile $DEST/apple-int.crt --outder | base64 -w0 > $DEST/apple-int.crt.der 2>>$DEST/certtool.log

exit $RET

0 comments on commit 2f04d2e

Please sign in to comment.