2 namespace TYPO3\CMS\Rsaauth\Storage;
39 if (session_id() ===
'') {
54 list($keyId, $keyPart1) = $_SESSION[
'tx_rsaauth_key'];
57 $this->databaseConnection->exec_DELETEquery(
'tx_rsaauth_keys',
'crdate<' . (
$GLOBALS[
'EXEC_TIME'] - 30 * 60));
59 $row = $this->databaseConnection->exec_SELECTgetSingleRow(
'key_value',
'tx_rsaauth_keys',
'uid=' . $keyId);
61 $result = $keyPart1 . $row[
'key_value'];
74 public function put($key)
78 list($keyId) = $_SESSION[
'tx_rsaauth_key'];
80 $this->databaseConnection->exec_DELETEquery(
'tx_rsaauth_keys',
'uid=' . $keyId);
81 unset($_SESSION[
'tx_rsaauth_key']);
87 $keyLength = strlen($key);
88 $splitPoint = rand((
int)($keyLength / 10), (
int)($keyLength / 2));
90 $keyPart1 = substr($key, 0, $splitPoint);
91 $keyPart2 = substr($key, $splitPoint);
97 $this->databaseConnection->exec_INSERTquery(
'tx_rsaauth_keys', array(
100 'key_value' => $keyPart2
102 $keyId = $this->databaseConnection->sql_insert_id();
104 $_SESSION[
'tx_rsaauth_key'] = array($keyId, $keyPart1);
107 $this->databaseConnection->exec_DELETEquery(
'tx_rsaauth_keys',
'crdate<' . (
$GLOBALS[
'EXEC_TIME'] - 30 * 60));