Skip to content

Commit f8777a0

Browse files
fix(aes-encryption): labels.Serialise cover case when encryption failed
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 842ecee commit f8777a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

endpoint/labels.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ func (l Labels) Serialize(withQuotes bool, txtEncryptEnabled bool, aesKey []byte
137137
}
138138

139139
var encryptionNonce []byte
140-
if extractedNonce, nonceExists := l[TxtEncryptionNonce]; nonceExists {
140+
if extractedNonce, nonceExists := l[txtEncryptionNonce]; nonceExists {
141141
encryptionNonce = []byte(extractedNonce)
142142
} else {
143143
var err error
144144
encryptionNonce, err = GenerateNonce()
145145
if err != nil {
146146
log.Fatalf("Failed to generate cryptographic nonce %#v.", err)
147147
}
148-
l[TxtEncryptionNonce] = string(encryptionNonce)
148+
l[txtEncryptionNonce] = string(encryptionNonce)
149149
}
150150

151151
text := l.SerializePlain(false)

0 commit comments

Comments
 (0)