SodiumException

Argument 1 must be at least CRYPTO_SIGN_BYTES long.

/mnt/data/shnoulle/nginx/www/master/third_party/paragonie/sodium_compat/src/Compat.php(2633)

2621      * @psalm-suppress MixedArgument
2622      * @psalm-suppress MixedInferredReturnType
2623      * @psalm-suppress MixedReturnStatement
2624      */
2625     public static function crypto_sign_open($signedMessage, $publicKey)
2626     {
2627         /* Type checks: */
2628         ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1);
2629         ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
2630 
2631         /* Input validation: */
2632         if (ParagonIE_Sodium_Core_Util::strlen($signedMessage) < self::CRYPTO_SIGN_BYTES) {
2633             throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_BYTES long.');
2634         }
2635         if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) {
2636             throw new SodiumException('Argument 2 must be CRYPTO_SIGN_PUBLICKEYBYTES long.');
2637         }
2638 
2639         if (self::useNewSodiumAPI()) {
2640             /**
2641              * @psalm-suppress InvalidReturnStatement
2642              * @psalm-suppress FalsableReturnStatement
2643              */
2644             return sodium_crypto_sign_open($signedMessage, $publicKey);
2645         }

Stack Trace

#0
+
 /mnt/data/shnoulle/nginx/www/master/application/core/LSSodium.php(118): ParagonIE_Sodium_Compat::crypto_sign_open()
113      */
114     public function decrypt($sEncryptedString, $bReturnFalseIfError = false)
115     {
116         if ($this->bLibraryExists === true) {
117             if (!empty($sEncryptedString) && $sEncryptedString != 'null') {
118                 $plaintext = ParagonIE_Sodium_Compat::crypto_sign_open(base64_decode($sEncryptedString), $this->sEncryptionPublicKey);
119                 if ($plaintext === false) {
120                     throw new SodiumException(sprintf(gT("Wrong decryption key! Decryption key has changed since this data were last saved, so data can't be decrypted. Please consult our manual at %s.", 'unescaped'), 'https://manual.limesurvey.org/Data_encryption#Errors'));
121                 } else {
122                     return $plaintext;
123                 }
#1
+
 /mnt/data/shnoulle/nginx/www/master/application/models/LSActiveRecord.php(430): LSSodium->decrypt()
425             $updatedValues = $LEM->getUpdatedValues();
426             foreach ($attributes as $key => $attribute) {
427                 if ($action === 'decrypt' && array_key_exists($key, $updatedValues)) {
428                     continue;
429                 }
430                 $this->$key = $sodium->$action($attribute);
431             }
432         }
433     }
434 
435     /**
#2
+
 /mnt/data/shnoulle/nginx/www/master/application/models/LSActiveRecord.php(337): LSActiveRecord->decryptEncryptAttributes()
332             $sodium = Yii::app()->sodium;
333 
334             return $sodium->decrypt($value);
335         } else {
336             // decrypt attributes
337             $this->decryptEncryptAttributes('decrypt');
338 
339             return $this;
340         }
341     }
342 
2021-06-05 08:56:41 nginx/1.20.0 Yii Framework/1.1.24-dev