freedomjs / freedom-pgp-e2e

Wrapping up end-to-end code and provide in freedom custom API.
34 stars 6 forks source link

No longer require --BEGIN * and --END lines. #43

Closed mollyling closed 8 years ago

mollyling commented 8 years ago

If we're always:

Can we omit the --BEGIN and --END lines? It's a rather strong characteristic for detection, and a little redundant in this case.

agallant commented 8 years ago

Easy enough to change, the only question is if omission is sensible for all cases or if this needs to be parameterized. I'll ponder, and of course your thoughts are welcome.

mollyling commented 8 years ago

I think wherever we'd diverge from this, we could put the relevant notation in another json key/value pair, probably for less space.

agallant commented 8 years ago

So I found a possible reason to not do this (or at least be careful with it) - https://github.com/google/end-to-end/blob/master/src/javascript/crypto/e2e/openpgp/asciiarmor.js#L223

Internally, e2e depends on these text header to tell whether or not something is clearsigned. At the moment actually clearsigning is broken in this module anyway, but I hope to fix it, and it may require having those headers still.

mollyling commented 8 years ago

I figured that we'd just sprintf() the block back around the text before giving it back to end-to-end. Essentially, strip the text off, send it, then put it back on. The protocol versioning we have can sufficiently indicate what to put back on.

agallant commented 8 years ago

Yeah there's definitely work arounds, and as I said this module doesn't actually work with clear signing at the moment anyway - just a consideration for when we do tweak the headers.

agallant commented 8 years ago

Just want to check - is this still needed? Thinking about it more I'm tempted to keep the API of this module unchanged as e2e itself depends on those lines, at least as default - stripping lines is doable in the a client app if needed, or if it really is a common use case then I'd add it as an optional/utility sort of call to this module.

mollyling commented 8 years ago

As a utility, yes please.

agallant commented 8 years ago

FYI this is now in release 0.6.4.