mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-28 02:20:30 -04:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
22 lines
642 B
YAML
22 lines
642 B
YAML
# Copyright IBM Corp. 2016, 2025
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
rules:
|
|
- id: use-hmac-equal
|
|
patterns:
|
|
- pattern-either:
|
|
- pattern: |
|
|
$MAC = hmac.New(...)
|
|
...
|
|
$H = $MAC.Sum(...)
|
|
...
|
|
bytes.Equal($H, ...)
|
|
- pattern: |
|
|
$MAC = hmac.New(...)
|
|
...
|
|
$H = $MAC.Sum(...)
|
|
...
|
|
bytes.Equal(..., $H)
|
|
message: "Comparing a MAC with bytes.Equal()"
|
|
languages: [go]
|
|
severity: ERROR
|