Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3ns
Commits
d73bc7a4
Unverified
Commit
d73bc7a4
authored
Oct 16, 2018
by
Steven Allen
Committed by
GitHub
Oct 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17 from ipfs/fix/extract-public-key
use new ExtractPublicKey signature
parents
da17c15c
9ed44165
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
ipns.go
ipns.go
+2
-5
package.json
package.json
+6
-6
record.go
record.go
+5
-5
No files found.
ipns.go
View file @
d73bc7a4
...
...
@@ -73,13 +73,10 @@ func EmbedPublicKey(pk ic.PubKey, entry *pb.IpnsEntry) error {
if
err
!=
nil
{
return
err
}
extracted
,
err
:=
id
.
ExtractPublicKey
()
if
err
!=
nil
{
if
_
,
err
:=
id
.
ExtractPublicKey
()
;
err
!=
peer
.
ErrNoPublicKey
{
// Either a *real* error or
nil
.
return
err
}
if
extracted
!=
nil
{
return
nil
}
// We failed to extract the public key from the peer ID, embed it in the
// record.
...
...
package.json
View file @
d73bc7a4
...
...
@@ -26,20 +26,20 @@
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
bNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3
"
,
"hash"
:
"Qm
TRhk7cgjUf2gfQ3p2M9KPECNZEW9XUrmHcFCgog4cPgB
"
,
"name"
:
"go-libp2p-peer"
,
"version"
:
"2.
3.8
"
"version"
:
"2.
4.0
"
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
WtCpWB39Rzc2xTB75MKorsxNpo3TyecTEN24CJ3KVohE
"
,
"hash"
:
"Qm
atE2nxsAaK96jxMFBPMtVJEsaMrcJ21UYBHpXTkEM95r
"
,
"name"
:
"go-libp2p-peerstore"
,
"version"
:
"2.0.
4
"
"version"
:
"2.0.
5
"
},
{
"hash"
:
"Qm
Sb4B8ZAAj5ALe9LjfzPyF8Ma6ezC1NTnDF2JQPUJxEXb
"
,
"hash"
:
"Qm
a9Eqp16mNHDX1EL73pcxhFfzbyXVcAYtaDd1xdmDRDtL
"
,
"name"
:
"go-libp2p-record"
,
"version"
:
"4.1.
7
"
"version"
:
"4.1.
8
"
},
{
"author"
:
"whyrusleeping"
,
...
...
record.go
View file @
d73bc7a4
...
...
@@ -61,12 +61,12 @@ func (v Validator) Validate(key string, value []byte) error {
}
func
(
v
Validator
)
getPublicKey
(
pid
peer
.
ID
,
entry
*
pb
.
IpnsEntry
)
(
ic
.
PubKey
,
error
)
{
pk
,
err
:=
ExtractPublicKey
(
pid
,
entry
)
if
err
!=
nil
{
return
nil
,
err
}
if
pk
!=
nil
{
switch
pk
,
err
:=
ExtractPublicKey
(
pid
,
entry
);
err
{
case
peer
.
ErrNoPublicKey
:
case
nil
:
return
pk
,
nil
default
:
return
nil
,
err
}
if
v
.
KeyBook
==
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment