Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for curves P256, P384, P521, SECP256K1, Ed25519/Curve25519 #628

Merged
merged 71 commits into from Feb 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
01be192
Object identifier type
Aug 12, 2016
d8b1e33
Result of wrapping a session key for ECDH key
Aug 12, 2016
26c6ab9
Parameters for the ECDH key derivation function
Aug 12, 2016
2f69d22
Key Wrap and Unwrap from RFC 3394
Aug 12, 2016
54b79be
Add and remove PKCS5 padding
Aug 12, 2016
a8e8271
Support functions for Elliptic Curve Cryptography
Aug 12, 2016
ba2f492
Signature creation and verification
Aug 12, 2016
673151e
Read and write ECDSA packets
Aug 12, 2016
585a2bd
Functions to encrypt and decrypt ECDH keys
Aug 12, 2016
38a53c1
Parse and create ECDH packets
Aug 12, 2016
075d7f8
Encrypt, decrypt, sign and verify with elliptic curve certificates
Aug 12, 2016
a5d9e6d
Generation of keys for elliptic curves
Aug 12, 2016
f87e759
Create key from provided material
Aug 12, 2016
ea1b0a1
Readme for modifications to support RFC 6637 - Elliptic Curve Cryptog…
Aug 12, 2016
fdcfcf3
refactor formatUserIds
Jul 24, 2017
3b8cea6
some style fixes, update tests
Jul 24, 2017
0de9eec
distinguish between key and subkey type, when refactoring key just gr…
Jul 24, 2017
fade832
remove material parameter for now
Jul 24, 2017
840c022
move hex2Uint8array to utils
Jul 26, 2017
cdc7004
refactor mpi, generalize mpi to params to account for non-mpi algorit…
Jul 26, 2017
b718cf3
simplify packet parsing using type maps
Jul 26, 2017
b40408d
standardize packet reading code, make pkcs5 function names same as pkcs1
Jul 27, 2017
26de171
use internal aes encrypt in key wrap, start refactoring aes to do dec…
Jul 29, 2017
cbe61e6
key expansion for aes decryption keys, aesdecrypt function
Jul 30, 2017
f8bfde7
comments, docs
Jul 30, 2017
86e15db
aes kw update
Nov 27, 2017
311d288
clone processing
Nov 27, 2017
8794446
change some variable names, add some curve parameters
Nov 27, 2017
c443988
restore package.json
Jan 4, 2018
6886cd6
elliptic/curves.js uses native code for genkey and sign/verify; sign/…
mahrud Jan 4, 2018
370a15e
Remove jshint/jscs and fix babelify
mahrud Jan 4, 2018
11a2d00
ESLint is happy!
mahrud Jan 4, 2018
12eb037
Everything in test/crypto/elliptic.js passes; working on test/general…
mahrud Jan 4, 2018
1a714ce
ECC with async/await is 'Done, without errors.'
mahrud Jan 4, 2018
21ae66c
encrypt/decrypt/sign/verify will always return promises
mahrud Jan 4, 2018
dcff16d
npm test and grunt browsertest can run side by side now; npm tests pa…
mahrud Jan 4, 2018
e6820d7
Passing all tests, on Node, Firefox, and Chrome
mahrud Jan 4, 2018
35f1844
keygen and sign/verify with ed25519 works
mahrud Jan 4, 2018
3e1d9c4
Fixes ECDH with Curve25519 and key import/export problems
mahrud Jan 4, 2018
3129e7c
Adds X25519 tests and updates README.md
mahrud Jan 4, 2018
5cb89f4
Addresses various review comments by @sanjanarajan
mahrud Jan 18, 2018
3ce6309
cleanup
Jan 19, 2018
a173a63
doc fixes
Jan 19, 2018
fa5805e
don't assume all mpi type for encsessionkey
Jan 19, 2018
d02b9c7
Fixes problems with user certificate verification.
mahrud Jan 23, 2018
2d1a113
Fixes bug in isRevoked, removes isValidSelfCertificate, adds verifyCe…
mahrud Jan 25, 2018
bf00fbd
added ECC curve options to docs
mahrud Jan 29, 2018
be2c605
Improves secret key encryption/decryption performance by 35%
mahrud Jan 29, 2018
aba8a7a
Switches to asmcrypto-lite for AES
mahrud Jan 30, 2018
d97bc06
Cleanups and doc fixes
mahrud Jan 31, 2018
a4134b9
Addresses various review comments by @bartbutler + some cleanups
mahrud Feb 1, 2018
496a45a
Update eddsa.js
Feb 1, 2018
76d7fac
eliminate openpgp_browser.js
Feb 1, 2018
40a8c54
exclude jwk-to-pem
Feb 1, 2018
5a6e65c
verification when decoding pkcs5
Feb 1, 2018
41f1e69
remove isValid
Feb 1, 2018
9e6005e
auto-scroll browser unit tests
Feb 1, 2018
9cbfbf4
Added contingency for when browser does not support NIST curves
mahrud Feb 1, 2018
3370eaa
Expands truncated little-endian parameters in EdDSA
mahrud Feb 2, 2018
115d1c0
A better patch for EdDSA truncation issue.
mahrud Feb 3, 2018
37eec2b
Added Ed25519 Test Vectors from RFC8032
mahrud Feb 4, 2018
ac440b9
use ES6 polyfill for worker and tests, not in openpgp.js
Feb 5, 2018
0b198b5
add extendedDebugging to saucelabs tests
Feb 5, 2018
d6cc820
add extendedDebugging correctly
Feb 5, 2018
1d82046
revert to Chrome 38
Feb 6, 2018
89f86d8
fix obsolete browser tests, add some polyfills
Feb 6, 2018
bdf1ce8
add some more polyfills for old browsers
Feb 6, 2018
210ec26
fix sporadic two password decryption failure
Feb 7, 2018
602bbb7
rename decryptSessionKey to decryptSessionKeys, return only unique se…
Feb 7, 2018
b2e39cc
Documentation and cleanups
mahrud Feb 7, 2018
1383107
Fixed and unmuted a few eslint errors, ~10 remain
mahrud Feb 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
363 changes: 363 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,363 @@
module.exports = {
"extends": "airbnb-base",
"parserOptions": { "sourceType": "module" },

"env": {
"browser": true,
"es6": true,
"node": true
},

"globals": { // TODO are all these necessary?
"console": true,
"Promise": true,
"importScripts": true,
"process": true,
"Event": true,
"describe": true,
"it": true,
"sinon": true,
"mocha": true,
"before": true,
"beforeEach": true,
"after": true,
"afterEach": true,
"escape": true,
"unescape": true,
"postMessage": true,
"resolves": true,
"rejects": true
},

"rules": {
// Auto generated rules:
"accessor-pairs": "error",
"array-bracket-newline": "error",
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"array-element-newline": "off",
"arrow-body-style": "off",
"arrow-parens": [
"error",
"as-needed"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "off",
"block-spacing": [
"error",
"always"
],
"brace-style": "off",
"callback-return": "error",
"camelcase": [
"error",
{
"properties": "never"
}
],
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": [ "error", "never" ],
"comma-spacing": "off",
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "error",
"curly": "error",
"default-case": "off",
"dot-location": "error",
"dot-notation": [
"error",
{
"allowKeywords": true
}
],
"eol-last": "off",
"eqeqeq": "error",
"for-direction": "error",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": [
"error",
"never"
],
"func-style": "off",
"function-paren-newline": "off",
"generator-star-spacing": "error",
"getter-return": "error",
"global-require": "off",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": [
"error",
"beside"
],
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "off",
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "error",
"lines-between-class-members": "error",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"multiline-ternary": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-bitwise": "off",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "error",
"no-continue": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-empty-function": "off",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "error",
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": [
"error",
{
"defaultAssignment": true
}
],
"no-unused-expressions": "error",
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "off",
"no-void": "error",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": [
"error",
{
"allowMultiplePropertiesPerLine": true
}
],
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": [
"error",
"initializations"
],
"operator-assignment": "off",
"operator-linebreak": [
"error",
"after"
],
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": [
"error",
"as-needed"
],
"require-await": "error",
"require-jsdoc": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": [
"error",
{
"after": true,
"before": false
}
],
"semi-style": [
"error",
"last"
],
"sort-imports": "off",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "off",
"space-unary-ops": "error",
"spaced-comment": "off",
"strict": "off",
"switch-colon-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
],

// Custom silencers:
"camelcase": 0,
"no-debugger": 0,
"require-await": 0,
"no-multi-assign": 0,
"no-underscore-dangle": 0,
"no-restricted-syntax": 0,
"one-var-declaration-per-line": 0,

// Custom errors:
"no-undef": 2,
"no-trailing-spaces": 2,
"no-mixed-operators": [ 2, {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}],
"no-use-before-define": [ 2, { "functions": false, "classes": true, "variables": false }],
"no-unused-expressions": [ 2, { "allowShortCircuit": true } ],

// Custom warnings:
"no-console": 0,
"no-unused-vars": 0,
"indent": [ 0, 2, { "SwitchCase": 1 } ],

// TODO Consider fixing these:
"new-cap": [ 0, { "properties": false, "capIsNewExceptionPattern": "^type_.*" }],
"no-lonely-if": 0,
"no-fallthrough": 0,
"no-invalid-this": 0,
"import/extensions": 0,
"no-useless-escape": 0,
"no-array-constructor": 0,
"no-constant-condition": 0,
"no-buffer-constructor": 0, // deprecated
"no-restricted-properties": 0 // Math.pow
}
};
4 changes: 0 additions & 4 deletions .jscsrc

This file was deleted.