-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
174a4cc
commit 26eaf53
Showing
1 changed file
with
49 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,75 @@ | ||
FIXME: add a description | ||
|
||
// If you want to factorize the description uncomment the following line and create the file. | ||
//include::../description.adoc[] | ||
include::../summary.adoc[] | ||
|
||
== Why is this an issue? | ||
|
||
FIXME: remove the unused optional headers (that are commented out) | ||
include::../rationale.adoc[] | ||
|
||
//=== What is the potential impact? | ||
include::../impact.adoc[] | ||
|
||
== How to fix it | ||
//== How to fix it in FRAMEWORK NAME | ||
|
||
=== Code examples | ||
|
||
==== Noncompliant code example | ||
|
||
[source,go,diff-id=1,diff-type=noncompliant] | ||
---- | ||
FIXME | ||
import ( | ||
"crypto/cipher" | ||
) | ||
func encrypt(block cipher.Block, plaintext []byte) { | ||
iv := []byte("fixed IVfixed IV") | ||
encrypter := cipher.NewCBCEncrypter(block, iv) | ||
encrypter.CryptBlocks(plaintext, plaintext) | ||
} | ||
---- | ||
|
||
==== Compliant solution | ||
|
||
include::../common/fix/explicit-fix.adoc[] | ||
|
||
[source,go,diff-id=1,diff-type=compliant] | ||
---- | ||
FIXME | ||
import ( | ||
"crypto/cipher" | ||
"crypto/rand" | ||
) | ||
func encrypt(block cipher.Block, plaintext []byte) { | ||
iv := make([]byte, block.BlockSize()) | ||
rand.Read(iv) | ||
encrypter := cipher.NewCBCEncrypter(block, iv) | ||
encrypter.CryptBlocks(plaintext, plaintext) | ||
} | ||
---- | ||
|
||
//=== How does this work? | ||
=== How does this work? | ||
|
||
include::../common/fix/fix.adoc[] | ||
|
||
|
||
|
||
== Resources | ||
|
||
include::../common/resources/docs.adoc[] | ||
|
||
include::../common/resources/articles.adoc[] | ||
|
||
include::../common/resources/presentations.adoc[] | ||
|
||
include::../common/resources/standards.adoc[] | ||
|
||
ifdef::env-github,rspecator-view[] | ||
|
||
''' | ||
== Implementation Specification | ||
(visible only on this page) | ||
|
||
//=== Pitfalls | ||
include::../message.adoc[] | ||
|
||
//=== Going the extra mile | ||
''' | ||
|
||
endif::env-github,rspecator-view[] | ||
|
||
//== Resources | ||
//=== Documentation | ||
//=== Articles & blog posts | ||
//=== Conference presentations | ||
//=== Standards | ||
//=== External coding guidelines | ||
//=== Benchmarks |