Skip to content

Commit

Permalink
New version to address keybase/keybase-issues#1410
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtaco committed Feb 25, 2015
1 parent bc4e96f commit 71d7d3e
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 67 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.0.7 (2015-02-24)

Features:
- Add a `no_check_keys` to KeyManager import routines for PGP. Needed in
the case of replacing an expired key.
- See here: https://github.com/keybase/keybase-issues/issues/1410

## 2.0.6 (2015-02-19)

Features:
Expand Down
13 changes: 7 additions & 6 deletions lib/openpgp/keymanager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 29 additions & 27 deletions lib/openpgp/processor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/openpgp/keymanager.iced
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ class KeyManager extends KeyManagerInterface
# @param {callback<err,KeyManager,Warnings>} cb Callback with the result;
# On success, we'll get an actual KeyManager.
#
@import_from_armored_pgp : ({armored, raw, binary, asp}, cb) ->
@import_from_armored_pgp : ({armored, raw, binary, asp, opts}, cb) ->
msg = binary
err = null

Expand All @@ -480,7 +480,7 @@ class KeyManager extends KeyManagerInterface
err = new Error "Wanted a public or private key; got: #{msg.type}"

unless err?
await KeyManager.import_from_pgp_message { msg, asp }, defer err, ret, warnings
await KeyManager.import_from_pgp_message { msg, asp, opts }, defer err, ret, warnings

# For keys that have unprotected secret key data, just unlock
# the secret key material by default, that way we don't have to
Expand Down Expand Up @@ -542,14 +542,14 @@ class KeyManager extends KeyManagerInterface
#--------------

# Import from a dearmored/decoded PGP message.
@import_from_pgp_message : ({msg, asp}, cb) ->
@import_from_pgp_message : ({msg, asp, opts}, cb) ->
asp = ASP.make asp
bundle = null
warnings = null
unless err?
[err,packets] = parse msg.body
unless err?
kb = new KeyBlock packets
kb = new KeyBlock packets, opts
await kb.process defer err
warnings = kb.warnings
unless err?
Expand Down
5 changes: 3 additions & 2 deletions src/openpgp/processor.iced
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ verify_detached = require('./detachsign').verify

class KeyBlock

constructor : (@packets) ->
constructor : (@packets, opts) ->
# We'll throw away signatures that aren't verified.
@verified_signatures = []
@subkeys = []
@primary = null
@userids = []
@user_attributes = []
@warnings = new Warnings()
@opts = opts or {}

#--------------------

Expand Down Expand Up @@ -84,7 +85,7 @@ class KeyBlock
process : (cb) ->
err = @_extract_keys()
await @_verify_sigs defer err unless err?
err = @_check_keys() unless err?
err = @_check_keys() unless err? or @opts?.no_check_keys
cb err

#--------------------
Expand Down
Loading

0 comments on commit 71d7d3e

Please sign in to comment.