Skip to content

Fix failed assertion with Mbed TLS 3#3017

Open
ayuusweetfish wants to merge 1 commit intoshadowsocks:masterfrom
ayuusweetfish:mbedtls3-aesgcm
Open

Fix failed assertion with Mbed TLS 3#3017
ayuusweetfish wants to merge 1 commit intoshadowsocks:masterfrom
ayuusweetfish:mbedtls3-aesgcm

Conversation

@ayuusweetfish
Copy link

When compiled against Mbed TLS 3 (on my environment, Fedora's mbedtls-3.6.5-1.fc42.aarch64), the client program reports a failed assertion:

ss-local: aead.c:521: aead_chunk_encrypt: Assertion `clen == CHUNK_SIZE_LEN + tlen' failed.

This appears to have been introduced by #2999. Indeed, the resource referenced there (fw876/helloworld#1504) provides a patch that contains an identical change; it might be an overlook when porting. I have tested the change with MSan and UBSan.

Ref. mbedtls_cipher_auth_encrypt_ext() documentation: "the tag will be appended to the ciphertext", so the output length already includes the tag and no longer needs another += tlen.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant