Skip to content

Commit 11cb442

Browse files
authored
Merge pull request #221 from bigbrett/aes-gcm-arg-relaxation
remove AES GCM output NULL check
2 parents 2640002 + af8a620 commit 11cb442

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wh_client_crypto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ int wh_Client_AesGcm(whClientContext* ctx, Aes* aes, int enc, const uint8_t* in,
692692
if ((ctx == NULL) || (aes == NULL) || ((in == NULL) && (len > 0)) ||
693693
((iv == NULL) && (iv_len > 0)) ||
694694
((authin == NULL) && (authin_len > 0)) ||
695-
((enc == 0) && (dec_tag == NULL)) || (out == NULL)) {
695+
((enc == 0) && (dec_tag == NULL))) {
696696
return WH_ERROR_BADARGS;
697697
}
698698

@@ -811,7 +811,7 @@ int wh_Client_AesGcm(whClientContext* ctx, Aes* aes, int enc, const uint8_t* in,
811811
res->authTagSz);
812812
}
813813
#endif
814-
/* copy the response result */
814+
/* copy the response result if present */
815815
if (out != NULL && res->sz == len) {
816816
memcpy(out, res_out, res->sz);
817817
}
@@ -859,7 +859,7 @@ int wh_Client_AesGcmDma(whClientContext* ctx, Aes* aes, int enc,
859859
uint32_t keyLen = 0;
860860
uint16_t reqLen;
861861

862-
if (ctx == NULL || aes == NULL || out == NULL) {
862+
if (ctx == NULL || aes == NULL) {
863863
return WH_ERROR_BADARGS;
864864
}
865865

0 commit comments

Comments
 (0)