Changeset View
Changeset View
Standalone View
Standalone View
src/future/oauth/PhutilOAuth1Future.php
| Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | switch ($this->signatureMethod) { | ||||
| } | } | ||||
| $signature = null; | $signature = null; | ||||
| $ok = openssl_sign($string, $signature, $pkey, OPENSSL_ALGO_SHA1); | $ok = openssl_sign($string, $signature, $pkey, OPENSSL_ALGO_SHA1); | ||||
| if (!$ok) { | if (!$ok) { | ||||
| throw new Exception(pht('%s failed!', 'openssl_sign()')); | throw new Exception(pht('%s failed!', 'openssl_sign()')); | ||||
| } | } | ||||
| openssl_free_key($pkey); | // Deprecated in PHP 8; key is automatically freed. | ||||
| @openssl_free_key($pkey); | |||||
| return base64_encode($signature); | return base64_encode($signature); | ||||
| case 'PLAINTEXT': | case 'PLAINTEXT': | ||||
| if (!$this->consumerSecret) { | if (!$this->consumerSecret) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| "Signature method '%s' requires %s!", | "Signature method '%s' requires %s!", | ||||
| 'PLAINTEXT', | 'PLAINTEXT', | ||||
| Show All 27 Lines | |||||