@@ -62,15 +62,14 @@ public function testSingedMessage()
62
62
63
63
Here is the message itself
64
64
-- $ boundary
65
- Content-Type: application/pkcs7-signature; name="smime\.p7s"
65
+ Content-Type: application/(x\-)? pkcs7-signature; name="smime\.p7s"
66
66
Content-Transfer-Encoding: base64
67
67
Content-Disposition: attachment; filename="smime\.p7s"
68
68
69
69
(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})
70
70
71
71
-- $ boundary--
72
72
OEL ;
73
-
74
73
$ this ->assertValidVerify ($ expectedBody , $ messageStream );
75
74
unset($ messageStream );
76
75
}
@@ -93,7 +92,7 @@ public function testSingedMessageBinary()
93
92
$ entityString = $ messageStream ->getContent ();
94
93
$ headers = self ::getHeadersOfMessage ($ entityString );
95
94
96
- if (' application/pkcs7-mime; smime-type=signed-data; ' !== substr ( $ headers ['content-type ' ], 0 , 47 )) {
95
+ if (! preg_match ( ' #^ application/(x\-)? pkcs7-mime; smime-type=signed\ -data;# ' , $ headers ['content-type ' ])) {
97
96
$ this ->fail ('Content-type does not match. ' );
98
97
99
98
return false ;
@@ -161,7 +160,7 @@ public function testSingedMessageWithAttachments()
161
160
--\\1--
162
161
163
162
-- $ boundary
164
- Content-Type: application/pkcs7-signature; name="smime\\.p7s"
163
+ Content-Type: application/(x\-)? pkcs7-signature; name="smime\\.p7s"
165
164
Content-Transfer-Encoding: base64
166
165
Content-Disposition: attachment; filename="smime\\.p7s"
167
166
@@ -194,7 +193,7 @@ public function testEncryptedMessage()
194
193
$ entityString = $ messageStream ->getContent ();
195
194
$ headers = self ::getHeadersOfMessage ($ entityString );
196
195
197
- if (' application/pkcs7-mime; smime-type=enveloped-data; ' !== substr ( $ headers ['content-type ' ], 0 , 50 )) {
196
+ if (! preg_match ( ' #^ application/(x\-)? pkcs7-mime; smime-type=enveloped\ -data;# ' , $ headers ['content-type ' ])) {
198
197
$ this ->fail ('Content-type does not match. ' );
199
198
200
199
return false ;
@@ -232,7 +231,7 @@ public function testEncryptedMessageWithMultipleCerts()
232
231
$ entityString = $ messageStream ->getContent ();
233
232
$ headers = self ::getHeadersOfMessage ($ entityString );
234
233
235
- if (' application/pkcs7-mime; smime-type=enveloped-data; ' !== substr ( $ headers ['content-type ' ], 0 , 50 )) {
234
+ if (! preg_match ( ' #^ application/(x\-)? pkcs7-mime; smime-type=enveloped\ -data;# ' , $ headers ['content-type ' ])) {
236
235
$ this ->fail ('Content-type does not match. ' );
237
236
238
237
return false ;
@@ -278,7 +277,7 @@ public function testSignThenEncryptedMessage()
278
277
$ entityString = $ messageStream ->getContent ();
279
278
$ headers = self ::getHeadersOfMessage ($ entityString );
280
279
281
- if (' application/pkcs7-mime; smime-type=enveloped-data; ' !== substr ( $ headers ['content-type ' ], 0 , 50 )) {
280
+ if (! preg_match ( ' #^ application/(x\-)? pkcs7-mime; smime-type=enveloped\ -data;# ' , $ headers ['content-type ' ])) {
282
281
$ this ->fail ('Content-type does not match. ' );
283
282
284
283
return false ;
@@ -308,7 +307,7 @@ public function testSignThenEncryptedMessage()
308
307
309
308
Here is the message itself
310
309
-- $ boundary
311
- Content-Type: application/pkcs7-signature; name="smime\.p7s"
310
+ Content-Type: application/(x\-)? pkcs7-signature; name="smime\.p7s"
312
311
Content-Transfer-Encoding: base64
313
312
Content-Disposition: attachment; filename="smime\.p7s"
314
313
@@ -356,14 +355,14 @@ public function testEncryptThenSignMessage()
356
355
-- $ boundary
357
356
(?P<encrypted_message>MIME-Version: 1\.0
358
357
Content-Disposition: attachment; filename="smime\.p7m"
359
- Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name="smime\.p7m"
358
+ Content-Type: application/(x\-)? pkcs7-mime; smime-type=enveloped-data; name="smime\.p7m"
360
359
Content-Transfer-Encoding: base64
361
360
362
361
(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})
363
362
364
363
365
364
)-- $ boundary
366
- Content-Type: application/pkcs7-signature; name="smime\.p7s"
365
+ Content-Type: application/(x\-)? pkcs7-signature; name="smime\.p7s"
367
366
Content-Transfer-Encoding: base64
368
367
Content-Disposition: attachment; filename="smime\.p7s"
369
368
0 commit comments