mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	fix #1253 handle incorrect values of SIGNATURE_TYPE and CRYPTO_TYPE
This commit is contained in:
		
							parent
							
								
									ecdf1f4ddc
								
							
						
					
					
						commit
						9e12cff317
					
				
					 1 changed files with 20 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1027,11 +1027,29 @@ namespace client
 | 
			
		|||
			{
 | 
			
		||||
				auto it = params->find (SAM_PARAM_SIGNATURE_TYPE);
 | 
			
		||||
				if (it != params->end ())
 | 
			
		||||
				{	
 | 
			
		||||
					// TODO: extract string values
 | 
			
		||||
					signatureType = std::stoi(it->second);
 | 
			
		||||
					try
 | 
			
		||||
					{	
 | 
			
		||||
						signatureType = std::stoi(it->second);
 | 
			
		||||
					}
 | 
			
		||||
					catch (const std::exception& ex) 
 | 
			
		||||
					{
 | 
			
		||||
						LogPrint (eLogWarning, "SAM: ", SAM_PARAM_SIGNATURE_TYPE, "error: ", ex.what ());	
 | 
			
		||||
					}		
 | 
			
		||||
				}	
 | 
			
		||||
				it = params->find (SAM_PARAM_CRYPTO_TYPE);
 | 
			
		||||
				if (it != params->end ())
 | 
			
		||||
					cryptoType = std::stoi(it->second);
 | 
			
		||||
				{	
 | 
			
		||||
					try
 | 
			
		||||
					{	
 | 
			
		||||
						cryptoType = std::stoi(it->second);
 | 
			
		||||
					}
 | 
			
		||||
					catch (const std::exception& ex) 
 | 
			
		||||
					{
 | 
			
		||||
						LogPrint (eLogWarning, "SAM: ", SAM_PARAM_CRYPTO_TYPE, "error: ", ex.what ());	
 | 
			
		||||
					}	
 | 
			
		||||
				}	
 | 
			
		||||
			}
 | 
			
		||||
			localDestination = i2p::client::context.CreateNewLocalDestination (true, signatureType, cryptoType, params);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue