mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
				synced 2025-11-03 20:18:01 +00:00 
			
		
		
		
	fixed GH #2603:Remove incorrect upper size limits for SSL certificates in NetSSL_Win
This commit is contained in:
		@@ -193,7 +193,6 @@ void Context::importCertificate()
 | 
				
			|||||||
	Poco::File certFile(_certNameOrPath);
 | 
						Poco::File certFile(_certNameOrPath);
 | 
				
			||||||
	if (!certFile.exists()) throw Poco::FileNotFoundException(_certNameOrPath);
 | 
						if (!certFile.exists()) throw Poco::FileNotFoundException(_certNameOrPath);
 | 
				
			||||||
	Poco::File::FileSize size = certFile.getSize();
 | 
						Poco::File::FileSize size = certFile.getSize();
 | 
				
			||||||
	if (size > 4096) throw Poco::DataFormatException("PKCS #12 certificate file too large", _certNameOrPath);
 | 
					 | 
				
			||||||
	Poco::Buffer<char> buffer(static_cast<std::size_t>(size));
 | 
						Poco::Buffer<char> buffer(static_cast<std::size_t>(size));
 | 
				
			||||||
	Poco::FileInputStream istr(_certNameOrPath);
 | 
						Poco::FileInputStream istr(_certNameOrPath);
 | 
				
			||||||
	istr.read(buffer.begin(), buffer.size());
 | 
						istr.read(buffer.begin(), buffer.size());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -397,7 +397,6 @@ void X509Certificate::importCertificate(const std::string& certPath)
 | 
				
			|||||||
	Poco::File certFile(certPath);
 | 
						Poco::File certFile(certPath);
 | 
				
			||||||
	if (!certFile.exists()) throw Poco::FileNotFoundException(certPath);
 | 
						if (!certFile.exists()) throw Poco::FileNotFoundException(certPath);
 | 
				
			||||||
	Poco::File::FileSize size = certFile.getSize();
 | 
						Poco::File::FileSize size = certFile.getSize();
 | 
				
			||||||
	if (size > 4096) throw Poco::DataFormatException("certificate file too large", certPath);
 | 
					 | 
				
			||||||
	if (size < 32) throw Poco::DataFormatException("certificate file too small", certPath);
 | 
						if (size < 32) throw Poco::DataFormatException("certificate file too small", certPath);
 | 
				
			||||||
	Poco::Buffer<char> buffer(static_cast<std::size_t>(size));
 | 
						Poco::Buffer<char> buffer(static_cast<std::size_t>(size));
 | 
				
			||||||
	Poco::FileInputStream istr(certPath);
 | 
						Poco::FileInputStream istr(certPath);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user