rspec/rules/S4790/highlighting.adoc
github-actions[bot] 7fe7e1eda0
Create rule S4790: Using weak hashing algorithms is security-sensitive: add Go (#2753)
You can preview this rule
[here](https://sonarsource.github.io/rspec/#/rspec/S4790/go) (updated a
few minutes after each push).

## Review

A dedicated reviewer checked the rule description successfully for:

- [x] logical errors and incorrect information
- [x] information gaps and missing content
- [x] text style and tone
- [x] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
2023-08-03 16:06:34 +02:00

21 lines
667 B
Plaintext

=== Highlighting
* When a hash is calculated using a single function call:
** The hashing function call
* When an object representing a weak hash function...
** ... is constructed:
*** The object construction statement
** ... is returned from a factory method provided by a supported framework/library:
*** The factory method call that returns the object
For example:
[source,csharp]
----
byte[] hash = MD5.HashData(data);
^^^^^^^^^^^^^^^^^^
HashAlgorithm obj1 = new MD5CryptoServiceProvider();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
HashAlgorithm obj2 = HashAlgorithm.Create("MD5");
^^^^^^^^^^^^^^^^^^^^^^^^^^^
----