-
Notifications
You must be signed in to change notification settings - Fork 26
Add concept of feed types for new signature / verification algorithms #61
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
db4b6ed
5171233
79c0e98
a0ee48a
a3e1611
1534697
fb4be5c
2adcc13
da1aa08
b272b2b
37bcf09
4b89258
22a9efb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,7 @@ module.exports = function (generate) { | |
|
|
||
| function reconstructKeys(keyfile) { | ||
| var privateKey = keyfile | ||
| .replace(/\s*\#[^\n]*/g, '') | ||
| .replace(/\s*#[^\n]*/g, '') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 I would honestly not fuck with the regex (unless you wrote tight tests).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, just tidying -- unused backslashes are a footgun IMO but I could make this change in another PR. Good call. I think we had a similar discussion about removing unused backslashes a little while ago too: ssbc/ssb-schema-definitions#3 (review)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true I didn't see the followup till just now. |
||
| .split('\n').filter(empty).join('') | ||
|
|
||
| //if the key is in JSON format, we are good. | ||
|
|
@@ -78,14 +78,14 @@ module.exports = function (generate) { | |
| return reconstructKeys(fs.readFileSync(filename, 'ascii')) | ||
| } | ||
|
|
||
| exports.create = function(filename, curve, legacy, cb) { | ||
| exports.create = function(filename, feedType, legacy, cb) { | ||
| if(isFunction(legacy)) | ||
| cb = legacy, legacy = null | ||
| if(isFunction(curve)) | ||
| cb = curve, curve = null | ||
| if(isFunction(feedType)) | ||
| cb = feedType, feedType = null | ||
|
|
||
| filename = toFile(filename) | ||
| var keys = generate(curve) | ||
| var keys = generate(feedType) | ||
| var keyfile = constructKeys(keys, legacy) | ||
| mkdirp(path.dirname(filename), function (err) { | ||
| if(err) return cb(err) | ||
|
|
@@ -96,9 +96,9 @@ module.exports = function (generate) { | |
| }) | ||
| } | ||
|
|
||
| exports.createSync = function(filename, curve, legacy) { | ||
| exports.createSync = function(filename, feedType, legacy) { | ||
| filename = toFile(filename) | ||
| var keys = generate(curve) | ||
| var keys = generate(feedType) | ||
| var keyfile = constructKeys(keys, legacy) | ||
| mkdirp.sync(path.dirname(filename)) | ||
| fs.writeFileSync(filename, keyfile, {mode: 0x100, flag: 'wx'}) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.