mirror of
				https://github.com/maxgoedjen/secretive.git
				synced 2025-10-31 15:30:57 +00:00 
			
		
		
		
	Fix fallback for name
This commit is contained in:
		
							parent
							
								
									c0e9c2d39a
								
							
						
					
					
						commit
						47850c8285
					
				| @ -220,7 +220,7 @@ extension Agent { | ||||
|         let certContent = try String(contentsOfFile:certificatePath, encoding: .utf8) | ||||
|         let certElements = certContent.trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: " ") | ||||
| 
 | ||||
|         guard certElements.count >= 3 else { | ||||
|         guard certElements.count >= 2 else { | ||||
|             logger.warning("Certificate found for \(secret.name) but failed to load") | ||||
|             throw OpenSSHCertificateError.parsingFailed | ||||
|         } | ||||
| @ -229,7 +229,7 @@ extension Agent { | ||||
|             throw OpenSSHCertificateError.parsingFailed | ||||
|         } | ||||
| 
 | ||||
|         if let certName = certElements[2].data(using: .utf8) { | ||||
|         if certElements.count >= 3, let certName = certElements[2].data(using: .utf8) { | ||||
|             return (certDecoded, certName) | ||||
|         } else if let certName = secret.name.data(using: .utf8) { | ||||
|             logger.info("Certificate for \(secret.name) does not have a name tag, using secret name instead") | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user