mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	VerifyConsistencyProof: properly return tree builder when two trees are the same
This commit is contained in:
		
							parent
							
								
									31f2316aa2
								
							
						
					
					
						commit
						36210a9544
					
				| @ -28,7 +28,10 @@ func VerifyConsistencyProof(proof ct.ConsistencyProof, first *ct.SignedTreeHead, | |||||||
| 		return false, nil | 		return false, nil | ||||||
| 	} | 	} | ||||||
| 	if first.TreeSize == second.TreeSize { | 	if first.TreeSize == second.TreeSize { | ||||||
| 		return bytes.Equal(first.SHA256RootHash[:], second.SHA256RootHash[:]) && len(proof) == 0, nil | 		if !(bytes.Equal(first.SHA256RootHash[:], second.SHA256RootHash[:]) && len(proof) == 0) { | ||||||
|  | 			return false, nil | ||||||
|  | 		} | ||||||
|  | 		return true, &MerkleTreeBuilder{stack: []ct.MerkleTreeNode{first.SHA256RootHash[:]}, size: 1} | ||||||
| 	} | 	} | ||||||
| 	if first.TreeSize == 0 { | 	if first.TreeSize == 0 { | ||||||
| 		// The purpose of the consistency proof is to ensure the append-only | 		// The purpose of the consistency proof is to ensure the append-only | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andrew Ayer
						Andrew Ayer