Skip to content

Commit

Permalink
Add an invalid utf8 test email
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Oct 10, 2024
1 parent 5aa9bfc commit b5f3199
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/circuits/tests/email_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,19 @@ describe("Email Auth", () => {
}
await expect(failFn).rejects.toThrow();
});

it("Verify a sent email with non-utf8 character", async () => {
const emailFilePath = path.join(__dirname, "./emails/email_auth_invalid_test1.eml");
const accountCode =
"0x01eb9b204cc24c3baee11accc37d253a9c53e92b1a2cc07763475c135d575b76";
const circuitInputs = await genEmailCircuitInput(emailFilePath, accountCode, {
maxHeaderLength: 1024,
ignoreBodyHashCheck: true,
});
async function failFn() {
const witness = await circuit.calculateWitness(circuitInputs);
await circuit.checkConstraints(witness);
}
await expect(failFn).rejects.toThrow();
});
});
83 changes: 83 additions & 0 deletions packages/circuits/tests/emails/email_auth_invalid_test1.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Delivered-To: [email protected]
Received: by 2002:a05:7010:4851:b0:403:8332:eb9c with SMTP id n17csp1004219mdi;
Thu, 10 Oct 2024 03:16:51 -0700 (PDT)
X-Received: by 2002:a17:902:f68e:b0:20c:895d:b41c with SMTP id d9443c01a7336-20c895db9d6mr26370195ad.41.1728555411499;
Thu, 10 Oct 2024 03:16:51 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1728555411; cv=none;
d=google.com; s=arc-20240605;
b=hLgWHORB2bUPXlG14L9i9qF3wy47/ajz04L/WYqj+kAE+x6t3wrgsUZPuc0aat2a68
5JEqWDq6g2oOKLfRyFDH+Gw7Atd5rCFyCQvix5wit3ZGKT4PMOrV4f9c2bzvTtUDMY1T
f4XRkhPXYvfumin715HcZmMM0ZKgv1lDw0DKnYphs3NQ962lsrrCxkHfXpBr5vfxOd5S
9ERilliltCUVoX4TjuNmS7qR6DNa2jYEw9Gs8btimxAhhGAVhYY+tVF52RhSayTyOMRq
mNr8UOp6lzjQqdWLN8ecYOC3a7iENdveG4w2pLm2Fa9D/gUKqaV40U0yUhyHo6sW9a1l
FAqQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=subject:to:from:date:message-id:dkim-signature;
bh=1iODMfYbGB0YsW+qkb/ylPSIB70wXGEkVgYLXH26p6U=;
fh=r9ZW45D/4i7BIl/4UeFGrkYKwbplztqhOVKfbV+WD3I=;
b=QcTr34vpV3TVGeCKL2CMxN/SmPJnoTBKdK9I6dqB8rVxUGQ6w1XqfZxSyDQKxC+DI4
JwvPxLQEZcqEGPjr4RJPeUd3DamebbS2TyHi7gFms5DQib1rafdj76//1ObTiMtTPlpI
mtWYWajMVSs++FpLQXp1XMqNYRbvkccpqk0j4wj5iwYuyvobH97Yv2nRvid8cdX039Wq
4MNJB9FsUGwqUDPIoyPGguEX5S5RKTYooIp38G8lsXoOxdtw0DJR5ZL/Gs0e8S7StFUf
/i3zXB7Pmx2FgCG6uAT1fcysG4pLNKe5E3Y3MrcTLXEzIn0w3Z3V1fACNkHFF8ay/s/I
3u0g==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass [email protected] header.s=20230601 header.b=hYAmcOut;
spf=pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) smtp.mailfrom=[email protected];
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass [email protected]
Return-Path: <[email protected]>
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
by mx.google.com with SMTPS id d9443c01a7336-20c8c3780f3sor6195485ad.19.2024.10.10.03.16.51
for <[email protected]>
(Google Transport Security);
Thu, 10 Oct 2024 03:16:51 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
Authentication-Results: mx.google.com;
dkim=pass [email protected] header.s=20230601 header.b=hYAmcOut;
spf=pass (google.com: domain of [email protected] designates 209.85.220.41 as permitted sender) smtp.mailfrom=[email protected];
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass [email protected]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1728555410; x=1729160210; dara=google.com;
h=subject:to:from:date:message-id:from:to:cc:subject:date:message-id
:reply-to;
bh=1iODMfYbGB0YsW+qkb/ylPSIB70wXGEkVgYLXH26p6U=;
b=hYAmcOutmZTFYcK/LSFg4MXKbRiPdUMjGpy0/Z5JgXyE/WrCYNxlkeuJC6HjYdZ2wM
3EO36M95rNNI15wR7+XhoLSSp/x3db7N9Yk/TpMUKPTzds+UgO/vOjrdk9gvgo/hCMgx
geoqNZuzMhOfS9VlXQcvarOmzcnQumD/mqw7YOH7dEe/0nN8mud6nRPFDPqn9jHmgfwk
MlllMXRwlkzcQsKy74Ew/PNrnz2aRTcmjVwwXGybvKhHHgPUIBrLVylxQ7IkzP8wQfBW
ZfE9RBjcWhwXka2kLWIhqMVNE5G+ZGILRz0pBGyTXww3LXpKt7W2Qt8XpWaeuwu8VtCV
HjJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1728555410; x=1729160210;
h=subject:to:from:date:message-id:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=1iODMfYbGB0YsW+qkb/ylPSIB70wXGEkVgYLXH26p6U=;
b=g3Fzh/Ujw9r2o0ockPKVQH7xXsPpqynm3KCPqMd5c3UtltnrPZCQ73gK2Gwjs+Ye7Y
PtlydjhjN6Cn0oInxeMvjBjmpGWdtBZ58ih+rXgcRp4CXajgdeqts2dFVcNTixk7Sojr
4AJAd+EKQuDWFA8yA8HtRTG5angQ8uqUc3N0RRiLjdDrnznyfIFn5DP1h9PIdQUu0S7O
XFix+AuDGVSYnTgBHCsJ9DfHTEFQvLTwSIyFwLNXfOSoEYIQR0xg2ElSCAAa+c5vSzUl
bi5C1AG/1QD5BtVCQZXfeuq809uFsx4+pXwrynUgKgSo/BnV+MYMETwfJc7dFn/JGir6
gBJg==
X-Gm-Message-State: AOJu0YzM0nASH0Qcd3Cp9W1A6jhYvFQZXh8E+Yl0wqw6ntS+PZ/kS9CT
R12Ps/acoprRoJ66pLPvIHXAyV6LyjBC9MD1FuK5O2T6Gj0VypE7XyS9RS4upSY=
X-Google-Smtp-Source: AGHT+IGR5twbXPQxXP91KzL6kIQv0YfEoH0Ry8NPblXLHL/gSi2nPIej4sSgmWI2mDlMqB96oMsgIw==
X-Received: by 2002:a17:902:d508:b0:20b:983c:f0a0 with SMTP id d9443c01a7336-20c6374311dmr89284895ad.31.1728555410624;
Thu, 10 Oct 2024 03:16:50 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail-255.txt ([240d:1e:4e1:3300:b452:6d47:1e35:4cb])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c0e7769sm6924285ad.142.2024.10.10.03.16.49
for <[email protected]>
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Thu, 10 Oct 2024 03:16:50 -0700 (PDT)
Message-ID: <[email protected]>
Date: Thu, 10 Oct 2024 03:16:50 -0700 (PDT)
from: [email protected]
To: [email protected]
Subject: This �s a test


ZK email?

0 comments on commit b5f3199

Please sign in to comment.