[Web] increase mysql publicKey field length
This commit is contained in:
		
							parent
							
								
									a2d57d43d1
								
							
						
					
					
						commit
						84b4269c75
					
				| @ -3,7 +3,7 @@ function init_db_schema() { | |||||||
|   try { |   try { | ||||||
|     global $pdo; |     global $pdo; | ||||||
| 
 | 
 | ||||||
|     $db_version = "18012022_1020"; |     $db_version = "14032022_0921"; | ||||||
| 
 | 
 | ||||||
|     $stmt = $pdo->query("SHOW TABLES LIKE 'versions'"); |     $stmt = $pdo->query("SHOW TABLES LIKE 'versions'"); | ||||||
|     $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC)); |     $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC)); | ||||||
| @ -699,7 +699,7 @@ function init_db_schema() { | |||||||
|           "authmech" => "ENUM('yubi_otp', 'u2f', 'hotp', 'totp', 'webauthn')", |           "authmech" => "ENUM('yubi_otp', 'u2f', 'hotp', 'totp', 'webauthn')", | ||||||
|           "secret" => "VARCHAR(255) DEFAULT NULL", |           "secret" => "VARCHAR(255) DEFAULT NULL", | ||||||
|           "keyHandle" => "VARCHAR(255) DEFAULT NULL", |           "keyHandle" => "VARCHAR(255) DEFAULT NULL", | ||||||
|           "publicKey" => "VARCHAR(255) DEFAULT NULL", |           "publicKey" => "VARCHAR(4096) DEFAULT NULL", | ||||||
|           "counter" => "INT NOT NULL DEFAULT '0'", |           "counter" => "INT NOT NULL DEFAULT '0'", | ||||||
|           "certificate" => "TEXT", |           "certificate" => "TEXT", | ||||||
|           "active" => "TINYINT(1) NOT NULL DEFAULT '0'" |           "active" => "TINYINT(1) NOT NULL DEFAULT '0'" | ||||||
|  | |||||||
| @ -175,15 +175,22 @@ if (isset($_GET['query'])) { | |||||||
|               // parse post data
 |               // parse post data
 | ||||||
|               $post = trim(file_get_contents('php://input')); |               $post = trim(file_get_contents('php://input')); | ||||||
|               if ($post) $post = json_decode($post); |               if ($post) $post = json_decode($post); | ||||||
| 
 |  | ||||||
|               // decode base64 strings
 |  | ||||||
|               $clientDataJSON = base64_decode($post->clientDataJSON); |  | ||||||
|               $attestationObject = base64_decode($post->attestationObject);              |  | ||||||
|                |                | ||||||
|               // process registration data from authenticator
 |               // process registration data from authenticator
 | ||||||
|               try { |               try { | ||||||
|  |                 // decode base64 strings
 | ||||||
|  |                 $clientDataJSON = base64_decode($post->clientDataJSON); | ||||||
|  |                 $attestationObject = base64_decode($post->attestationObject);    | ||||||
|  | 
 | ||||||
|                 // processCreate($clientDataJSON, $attestationObject, $challenge, $requireUserVerification=false, $requireUserPresent=true, $failIfRootMismatch=true)
 |                 // processCreate($clientDataJSON, $attestationObject, $challenge, $requireUserVerification=false, $requireUserPresent=true, $failIfRootMismatch=true)
 | ||||||
|                 $data = $WebAuthn->processCreate($clientDataJSON, $attestationObject, $_SESSION['challenge'], false, true); |                 $data = $WebAuthn->processCreate($clientDataJSON, $attestationObject, $_SESSION['challenge'], false, true); | ||||||
|  | 
 | ||||||
|  |                 // safe authenticator in mysql `tfa` table
 | ||||||
|  |                 $_data['tfa_method'] = $post->tfa_method; | ||||||
|  |                 $_data['key_id'] = $post->key_id; | ||||||
|  |                 $_data['confirm_password'] = $post->confirm_password; | ||||||
|  |                 $_data['registration'] = $data; | ||||||
|  |                 set_tfa($_data); | ||||||
|               } |               } | ||||||
|               catch (Throwable $ex) { |               catch (Throwable $ex) { | ||||||
|                 // err
 |                 // err
 | ||||||
| @ -194,12 +201,6 @@ if (isset($_GET['query'])) { | |||||||
|                 exit; |                 exit; | ||||||
|               } |               } | ||||||
| 
 | 
 | ||||||
|               // safe authenticator in mysql `tfa` table
 |  | ||||||
|               $_data['tfa_method'] = $post->tfa_method; |  | ||||||
|               $_data['key_id'] = $post->key_id; |  | ||||||
|               $_data['confirm_password'] = $post->confirm_password; |  | ||||||
|               $_data['registration'] = $data; |  | ||||||
|               set_tfa($_data); |  | ||||||
| 
 | 
 | ||||||
|               // send response
 |               // send response
 | ||||||
|               $return = new stdClass(); |               $return = new stdClass(); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 FreddleSpl0it
						FreddleSpl0it