Skip to content

Commit aa9865c

Browse files
Check whether secrets are empty and mark them all as sensitive
1 parent c445b16 commit aa9865c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Transport/Smtp/Auth/CramMd5Authenticator.php

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Transport\Smtp\Auth;
1313

14+
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
1415
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
1516

1617
/**
@@ -41,6 +42,10 @@ public function authenticate(EsmtpTransport $client): void
4142
*/
4243
private function getResponse(#[\SensitiveParameter] string $secret, string $challenge): string
4344
{
45+
if (!$secret) {
46+
throw new InvalidArgumentException('A non-empty secret is required.');
47+
}
48+
4449
if (\strlen($secret) > 64) {
4550
$secret = pack('H32', md5($secret));
4651
}

0 commit comments

Comments
 (0)