Refuse the +sct +issuer +ctlog flags when fetching hash tiles
This commit is contained in:
@@ -211,7 +211,7 @@ func DumpAllEntries(tileData []byte, opts Options) (*DumpResult, error) {
|
||||
if err != nil {
|
||||
// If it fails, try as hash tile
|
||||
fmt.Fprintf(os.Stderr, "Not a data tile, trying as hash tile...\n")
|
||||
return dumpHashTile(tileData)
|
||||
return dumpHashTile(tileData, opts)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
@@ -237,7 +237,11 @@ func dumpDataTile(tileData []byte, opts Options) (*DumpResult, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func dumpHashTile(tileData []byte) (*DumpResult, error) {
|
||||
func dumpHashTile(tileData []byte, opts Options) (*DumpResult, error) {
|
||||
if opts.ShowSCT || opts.ShowIssuer || opts.ShowCTLog {
|
||||
return nil, fmt.Errorf("+sct, +issuer, and +ctlog are not valid for hash tiles (only data tiles contain certificates)")
|
||||
}
|
||||
|
||||
const hashSize = 32 // SHA-256 hash size
|
||||
|
||||
if len(tileData)%hashSize != 0 {
|
||||
|
||||
Reference in New Issue
Block a user