Disallow DKIM L

This commit is contained in:
M66B 2024-05-18 15:38:02 +02:00
parent 74a92c9e67
commit fbc120d099
1 changed files with 2 additions and 7 deletions

View File

@ -2512,13 +2512,8 @@ public class MessageHelper {
throw new IllegalArgumentException(c[1]);
String length = kv.get("l");
if (!TextUtils.isEmpty(length) && TextUtils.isDigitsOnly(length)) {
int l = Integer.parseInt(length);
if (l < DKIM_MIN_TEXT)
throw new IllegalArgumentException("Body length " + l + " < " + DKIM_MIN_TEXT);
if (l < body.length())
body = body.substring(0, l);
}
if (!TextUtils.isEmpty(length))
throw new IllegalArgumentException("Length l=" + length);
Log.i("DKIM body=" + body.replace("\r\n", "|"));