-
Notifications
You must be signed in to change notification settings - Fork 300
e2e library for handling PGP/MIME messages #323
Conversation
…-to-end into cleanup-mime
I've ported the library to e2e and made a number of changes to the original code. The library will require some more work before it's finished, but I'd appreciate any advice/feedback at this point. As of now, the library only supports the building of an outgoing PGP/MIME message. I will soon add the parsing of incoming messages.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
goog.typeOf(this.content_) !== 'string') { | ||
// lines are wrapped at 64 chars, per the PEM protocol. Newline characters | ||
// will be stripped out of any encrypted content during decryption | ||
lines.push(goog.typeOf(this.content_) === 'string' ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the indentation in the following lines seems wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look a bit funny, though lint approved it. I'll change it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, weird. I guess lint knows better than me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean lines 161/162, they look Googley to me.
'Content-Type: application/octet-stream', | ||
'Content-Transfer-Encoding: base64', | ||
'Content-Disposition: attachment; filename="example.txt"', '', | ||
e2e.openpgp.pgpmime.Text.prettyTextWrap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to put the literal string here, not call prettyTextWrap
. That way, the expected result doesn't depend on the function working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll change that.
lgtm other than comments above. BTW, I should be covered under the Google corporate CLA (for Yahoo). |
…o prettyTextWrap from text.js and changed the way buildMimeTree (in pgpmail.js) is called
*/ | ||
|
||
/** | ||
* @fileoverview main module for the safemail app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"main module" -> "Main module"
optionalHeaders: [ | ||
{name: constants.Mime.CONTENT_TYPE, | ||
value: constants.Mime.ENCRYPTED, | ||
params: {'charset': 'utf-8', 'name': 'version.asc'}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make version.asc and encrypted.asc constants.
LGTM modulo comments I've given. |
}, this)); | ||
} | ||
|
||
this.setBoundary_(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set it in buildMessage. That way the constructor is cheaper, and at that time you can generate a boundary that does not collide with the content.
…d parameters are valid, and various other fixes
Added tests for the regexp Header Value verification. Various other small tweaks.
Added library for handling PGP/MIME messages.
The original library was built by Yan Zhu from yahoo.
I've ported the library to e2e and made a number of changes to the original code.
The library will require some more work before it's finished, but I'd appreciate any advice/feedback at this point.
As of now, the library only supports the building of an outgoing PGP/MIME message.
I'll soon add the parsing of incoming messages.
@diracdeltas