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

plumb through dohash; fix client section #172

Merged
merged 1 commit into from Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.3.19 (2020-02-21)

- the client field was in the wrong place and didn't agree with Go

## 2.3.18 (2020-02-05)

- rename WoT attest -> vouch
Expand Down
44 changes: 26 additions & 18 deletions lib/base.js

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

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -27,7 +27,7 @@
"iced-error": ">=0.0.9",
"iced-lock": "^1.0.1",
"iced-runtime": ">=0.0.1",
"kbpgp": ">=2.1.7",
"kbpgp": ">=2.1.12",
"pgp-utils": ">=0.0.22",
"purepack": "^1.0.4",
"triplesec": ">=3.0.16"
Expand All @@ -36,4 +36,4 @@
"iced-coffee-script": "^108.0.11",
"iced-test": "0.0.22"
}
}
}
13 changes: 7 additions & 6 deletions src/base.iced
Expand Up @@ -542,7 +542,7 @@ class Base

ret.high_skip = @high_skip if @high_skip?

ret.body.client = @client if @client?
ret.client = @client if @client?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think this horks anything?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not anything I can think of right now

ret.body.merkle_root = @merkle_root if @merkle_root?
ret.body.revoke = @revoke if @has_revoke()

Expand Down Expand Up @@ -574,9 +574,10 @@ class Base

#------

generate_v2 : (cb) ->
generate_v2 : (cb, {dohash} = {}) ->
# If @seq_type isn't specified, then default to public
@seq_type or= constants.seq_types.PUBLIC
dohash or= false

esc = make_esc cb, "generate"
out = null
Expand All @@ -585,17 +586,17 @@ class Base
await @generate_json opts, esc defer s, o, expansions
inner = { str : s, obj : o }
await @generate_outer { inner }, esc defer outer
await @sig_eng.box outer, esc defer {pgp, raw, armored}
await @sig_eng.box outer, esc(defer({pgp, raw, armored})), { dohash }
{short_id, id} = make_ids raw
out = { pgp, id, short_id, raw, armored, inner, outer, expansions }
cb null, out

#------

generate_versioned : ({version}, cb) ->
generate_versioned : ({version, dohash}, cb) ->
switch version
when constants.versions.sig_v2 then @generate_v2 cb
else @generate cb
when constants.versions.sig_v2 then @generate_v2(cb, {dohash})
else @generate(cb, {dohash})

#------

Expand Down