Closed Bug 778817 Opened 12 years ago Closed 11 years ago

Provide Base64UrlDecode in IdentityCryptoService

Categories

(Core Graveyard :: Identity, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: jedp, Assigned: jedp)

References

Details

Attachments

(1 file, 3 obsolete files)

Attached patch expose b64 decode; unit tests (obsolete) (deleted) — Splinter Review
Needed to decode b64-encoded assertions
Attachment #647239 - Flags: review?(benadida)
Comment on attachment 647239 [details] [diff] [review]
expose b64 decode; unit tests

looks good. Non-blocking question: why new UUIDs?
Attachment #647239 - Flags: review?(benadida) → review+
(In reply to Ben Adida [:benadida] from comment #1)
> Comment on attachment 647239 [details] [diff] [review]
> expose b64 decode; unit tests
> 
> looks good. Non-blocking question: why new UUIDs?

Thanks for the review, Ben!

I guess new UUIDs aren't necessary for the other functions, true.  Perhaps I ought to change those back to make subsequent merges less likely to be painful?
(In reply to Jed Parsons [:jparsons] from comment #2)
> I guess new UUIDs aren't necessary for the other functions, true.  Perhaps I
> ought to change those back to make subsequent merges less likely to be
> painful?

Nah, it's okay, like I said, non-blocking :)
Assignee: nobody → jparsons
blocking-basecamp: --- → +
Does this bug need to be checked in?

Looks like an old bug - does this still block?
Blocks: basecamp-id
This bug has been called out as likely having risk to non-B2G platforms. Given that, marking as P1, and moving into the C2 milestone. We should prioritize this landing to mozilla-beta as soon as possible, to prevent late-breaking regressions to other platforms.
Priority: -- → P1
Target Milestone: --- → B2G C2 (20nov-10dec)
Spoke with Jed about this - this is no longer needed for v1 of basecamp, so removing the basecamp flag.
blocking-basecamp: + → ---
Priority: P1 → --
Target Milestone: B2G C2 (20nov-10dec) → ---
No longer blocks: basecamp-id
Summary: Provide b64 decode in IdentityCryptoService → Provide Base64UrlDecode in IdentityCryptoService
It turns out we have need for this now in Bug 878941.

I've updated this patch so that it still applies.  Ben, can I ask you for a fresh review?
Attachment #647239 - Attachment is obsolete: true
Attachment #766149 - Flags: review?(benadida)
Comment on attachment 766149 [details] [diff] [review]
Add and expose Base64UrlDecode in IdentityCryptoService

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

looks good to me, may want a quick look at this from bsmith.
Attachment #766149 - Flags: review?(benadida)
Attachment #766149 - Flags: review+
Attachment #766149 - Flags: feedback?(bsmith)
Comment on attachment 766149 [details] [diff] [review]
Add and expose Base64UrlDecode in IdentityCryptoService

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

::: toolkit/identity/IdentityCryptoService.cpp
@@ +261,5 @@
>    return Base64UrlEncodeImpl(utf8Input, result);
>  }
>  
> +NS_IMETHODIMP
> +IdentityCryptoService::Base64UrlDecode(const nsACString & base64Input, 

trailing whitespace.

::: toolkit/identity/nsIIdentityCryptoService.idl
@@ +44,5 @@
>    void generateKeyPair(in AUTF8String algorithm,
>                         in nsIIdentityKeyGenCallback callback);
>  
>    ACString base64UrlEncode(in AUTF8String toEncode);
> +  ACString base64UrlDecode(in AUTF8String toDecode);

You must change the UUID of an interface whenever you add/remove/modify things within it. The reason for this rule has to do with the possibility of something (e.g. a native code extension) providing its own implementation of the interface, and the UUID mechanism is designed to help such extensions. (Sadly, [builtinclass] doesn't stop extensions from doing that.)
Attachment #766149 - Flags: feedback?(bsmith) → feedback+
Thanks for the feedback, Brian.  I've changed the uuid for that interface.
Attachment #766149 - Attachment is obsolete: true
Attachment #767351 - Flags: review?(bsmith)
... and trailing whitespace removed
Attachment #767351 - Attachment is obsolete: true
Attachment #767351 - Flags: review?(bsmith)
Attachment #767353 - Flags: review?(bsmith)
Attachment #767353 - Flags: review?(brian) → review+
Why atob/btoa is insufficient?
Can anyone answer comment #13?
https://hg.mozilla.org/mozilla-central/rev/534fd5ea4363
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
(In reply to Masatoshi Kimura [:emk] from comment #15)
> Can anyone answer comment #13?

I think you're correct that we can and should use atob and btoa as the core of these functions.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: