浏览代码

Check if aad is empty

Marcin Krzyzanowski 6 年之前
父节点
当前提交
f540bee631
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Sources/CryptoSwift/BlockMode/CCM.swift

+ 1 - 1
Sources/CryptoSwift/BlockMode/CCM.swift

@@ -115,7 +115,7 @@ class CCMModeWorker: StreamModeWorker, SeekableModeWorker, CounterModeWorker, Fi
         let hasAssociatedData = additionalAuthenticatedData != nil && !additionalAuthenticatedData!.isEmpty
         processControlInformation(nonce: self.nonce, tagLength: tagLength, hasAssociatedData: hasAssociatedData)
 
-        if let aad = additionalAuthenticatedData {
+        if let aad = additionalAuthenticatedData, hasAssociatedData {
             process(aad: aad)
         }
     }