File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ public function sign($data)
8282 "PHP 5.3.0 or higher is required to use service accounts. "
8383 );
8484 }
85- if (!openssl_sign ($ data , $ signature , $ this ->privateKey , "sha256 " )) {
85+ $ hash = defined ("OPENSSL_ALGO_SHA256 " ) ? OPENSSL_ALGO_SHA256 : "sha256 " ;
86+ if (!openssl_sign ($ data , $ signature , $ this ->privateKey , $ hash )) {
8687 throw new Google_Auth_Exception ("Unable to sign data " );
8788 }
8889 return $ signature ;
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ public function __destruct()
6464 */
6565 public function verify ($ data , $ signature )
6666 {
67- $ status = openssl_verify ($ data , $ signature , $ this ->publicKey , "sha256 " );
67+ $ hash = defined ("OPENSSL_ALGO_SHA256 " ) ? OPENSSL_ALGO_SHA256 : "sha256 " ;
68+ $ status = openssl_verify ($ data , $ signature , $ this ->publicKey , $ hash );
6869 if ($ status === -1 ) {
6970 throw new Google_Auth_Exception ('Signature verification error: ' . openssl_error_string ());
7071 }
You can’t perform that action at this time.
0 commit comments