Skip to content

Commit b3770ba

Browse files
committed
HSM: fix cosmetic indents
Final one
1 parent ec30209 commit b3770ba

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

ext/openssl/tests/openssl_pkey_get_public_rfc7512.phpt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,17 @@ mkdir($SOFTHSM2_TOKENDIR);
4747
$PHP11_PIN=123456;
4848
$PHP11_SOPIN=12345678;
4949

50-
file_put_contents($SOFTHSM2_CONF, sprintf(
51-
"directories.tokendir = %s".PHP_EOL.
52-
"objectstore.backend = file".PHP_EOL.
53-
"log.level = DEBUG".PHP_EOL.
54-
"slots.removable = false".PHP_EOL.
50+
file_put_contents(
51+
$SOFTHSM2_CONF,
52+
sprintf(
53+
"directories.tokendir = %s" . PHP_EOL.
54+
"objectstore.backend = file" . PHP_EOL.
55+
"log.level = DEBUG" . PHP_EOL.
56+
"slots.removable = false" . PHP_EOL.
5557
"slots.mechanisms = ALL",
56-
$SOFTHSM2_TOKENDIR));
58+
$SOFTHSM2_TOKENDIR
59+
)
60+
);
5761

5862
putenv(sprintf("SOFTHSM2_CONF=%s", $SOFTHSM2_CONF));
5963
sexec("softhsm2-util --show-slots | grep ^Slot | cut -d ' ' -f 2", $out);
@@ -72,7 +76,7 @@ sexec(sprintf("softhsm2-util --init-token --free --slot %d --label TestVJToken -
7276
sexec(sprintf("pkcs11-dump slotlist %s 2>/dev/null | grep SoftHSM | head -1 | cut -f 1",
7377
$PKCS11_MODULE_PATH), $PHP11_SLOT);
7478
if (!is_string($PHP11_SLOT)) {
75-
echo "Cannot detect the slot".PHP_EOL;
79+
echo "Cannot detect the slot" . PHP_EOL;
7680
exit(1);
7781
}
7882
$PHP11_SLOT=(int)$PHP11_SLOT;
@@ -109,31 +113,31 @@ sexec(sprintf("pkcs11-tool --login --pin %s --write-object %s --type cert --l
109113

110114
$key = openssl_pkey_get_private(sprintf("pkcs11:object=VJPrivKey;type=private;pin-value=%s", $PHP11_PIN));
111115
if (!($key instanceof OpenSSLAsymmetricKey)) {
112-
echo "Private Key NOK".PHP_EOL;
116+
echo "Private Key NOK" . PHP_EOL;
113117
exit(1);
114118
}
115-
echo "Private Key OK".PHP_EOL;
119+
echo "Private Key OK" . PHP_EOL;
116120

117121
$key = openssl_pkey_get_public(sprintf("pkcs11:object=VJPubKey;type=public"));
118122
if (!($key instanceof OpenSSLAsymmetricKey)) {
119-
echo "Public Key NOK".PHP_EOL;
123+
echo "Public Key NOK" . PHP_EOL;
120124
exit(1);
121125
}
122-
echo "Public Key OK".PHP_EOL;
126+
echo "Public Key OK" . PHP_EOL;
123127

124128
$cert = openssl_x509_read(sprintf("pkcs11:object=VJCert;type=cert"));
125129
if (!($cert instanceof OpenSSLCertificate)) {
126-
echo "Cert NOK".PHP_EOL;
130+
echo "Cert NOK" . PHP_EOL;
127131
exit(1);
128132
}
129-
echo "Cert OK".PHP_EOL;
133+
echo "Cert OK" . PHP_EOL;
130134
$certArray=openssl_x509_parse($cert);
131135

132136
if ($certArray['name'] !== "/CN=MyCertVJ") {
133-
echo "Cert content NOK".PHP_EOL;
137+
echo "Cert content NOK" . PHP_EOL;
134138
exit(1);
135139
}
136-
echo "Cert content OK".PHP_EOL;
140+
echo "Cert content OK" . PHP_EOL;
137141

138142
?>
139143
--EXPECT--

0 commit comments

Comments
 (0)