Skip to content

NewGCM(..) operates in strict mode even if flag isn't set #166

Open
@Radisovik

Description

@Radisovik

This behavior was un-expected, and I think is a bug. However maybe I don't fully understand the intent.

func (c *aesCipher) NewGCM(nonceSize, tagSize int) (cipher.AEAD, error) {
	if !ExecutingTest() || IsStrictFips() {
		if nonceSize != gcmStandardNonceSize {
			return nil, errors.New("crypto/aes: GCM nonce size can't be non-standard")
		}
		if tagSize != gcmTagSize {
			return nil, errors.New("crypto/aes: GCM tag size can't be non-standard")
		}

I believe the || should be an &&. As this stands now, anytime we're not running _test code, we're enforcing strict checking of the default nonce size..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions