Closed Bug 1530099 Opened 5 years ago Closed 5 years ago

re-export findCertByEmailAddress to IDL/JS

Categories

(MailNews Core :: Security: S/MIME, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 67.0

People

(Reporter: KaiE, Assigned: KaiE)

References

Details

Attachments

(2 files, 1 obsolete file)

In 2018, findCertByEmailAddress was removed from Gecko, and imported into TB, see bug 1453778.

But it was no longer exported to JS/IDL. We need this function in bug 1011625, so I'll add a patch to export it again.

Attached patch 1530099-v1.patch (obsolete) — Splinter Review
Attachment #9046124 - Flags: review?(mkmelin+mozilla)
Depends on: 1453778
Comment on attachment 9046124 [details] [diff] [review]
1530099-v1.patch

Review of attachment 9046124 [details] [diff] [review]:
-----------------------------------------------------------------

r=mkmelin with some comments addressed

::: mailnews/compose/public/nsIMsgComposeSecure.idl
@@ +76,5 @@
> +    /**
> +     *  Find a certificate by email address.
> +     *
> +     *  @param aEmailAddress The email address to be used as the key
> +     *                       to find the certificate.

please document aRequireValidCert too (although perhaps not hard to guess)

I think we should probably also document here, that it's mainly intended for testing purposes, and that it blocks the main thread and can cause nested event loop spinning.

::: mailnews/extensions/smime/src/nsSMimeJSHelper.cpp
@@ +114,5 @@
>          nsCString email_lowercase;
>          ToLowerCase(email, email_lowercase);
>  
> +        nsCOMPtr<nsIMsgComposeSecure> composeSecure =
> +           do_CreateInstance(NS_MSGCOMPOSESECURE_CONTRACTID, &rv);

need to check rv

@@ +224,5 @@
>        nsCString email_lowercase;
>        ToLowerCase(mailboxes[i], email_lowercase);
>  
> +      nsCOMPtr<nsIMsgComposeSecure> composeSecure =
> +         do_CreateInstance(NS_MSGCOMPOSESECURE_CONTRACTID, &rv);

need to check rv
Attachment #9046124 - Flags: review?(mkmelin+mozilla) → review+
Attached patch 1530099-v2.patchSplinter Review

changed as requested.

Attachment #9046124 - Attachment is obsolete: true
Attachment #9046218 - Flags: review+

Jörg, could you please land it?

Flags: needinfo?(jorgk)

We just use checkin-needed

Flags: needinfo?(jorgk)
Keywords: checkin-needed

It would be good if you could submit patches with a proper HG header, ... and actually in a way they can be applied :-(

$ hg qpush
applying 1530099-v2.patch
unable to find 'compose/public/nsIMsgComposeSecure.idl' for patching
(use '--prefix' to apply patch relative to the current directory)
2 out of 2 hunks FAILED -- saving rejects to file compose/public/nsIMsgComposeSecure.idl.rej
unable to find 'extensions/smime/src/nsMsgComposeSecure.cpp' for patching
(use '--prefix' to apply patch relative to the current directory)
1 out of 1 hunks FAILED -- saving rejects to file extensions/smime/src/nsMsgComposeSecure.cpp.rej
unable to find 'extensions/smime/src/nsMsgComposeSecure.h' for patching
(use '--prefix' to apply patch relative to the current directory)
1 out of 1 hunks FAILED -- saving rejects to file extensions/smime/src/nsMsgComposeSecure.h.rej
unable to find 'extensions/smime/src/nsSMimeJSHelper.cpp' for patching
(use '--prefix' to apply patch relative to the current directory)
5 out of 5 hunks FAILED -- saving rejects to file extensions/smime/src/nsSMimeJSHelper.cpp.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and qrefresh 1530099-v2.patch

The problem is that your patches (this is not the first one) have:

diff --git mailnews/compose/public/nsIMsgComposeSecure.idl mailnews/compose/public/nsIMsgComposeSecure.idl
--- mailnews/compose/public/nsIMsgComposeSecure.idl
+++ mailnews/compose/public/nsIMsgComposeSecure.idl

That doesn't work, it needs a/mailnews/compose/public/nsIMsgComposeSecure.idl b/mailnews/compose/public/nsIMsgComposeSecure.idl

Flags: needinfo?(kaie)

If you use mercurial queues, |hg export qtip|

The patch could have been applied using cd comm; cat patchfile | patch -p0

Ok, I was used to landing all patches myself, and I just typed the commit comment at the type I did the commit.

I'll have to remember that you need the patches to be complete. Will attach a bette one.

Attached patch 1530099-v4.patchSplinter Review
Flags: needinfo?(kaie)

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/78e76b014af7
re-export findCertByEmailAddress to IDL/JS. r=mkmelin

Status: NEW → RESOLVED
Closed: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 67.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: