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-dms3
Commits
84fe5827
Commit
84fe5827
authored
Jan 31, 2018
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
namesys: more comments
License: MIT Signed-off-by:
Dirk McCormick
<
dirkmdev@gmail.com
>
parent
dbedee59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
namesys/validator.go
namesys/validator.go
+6
-3
No files found.
namesys/validator.go
View file @
84fe5827
...
...
@@ -41,12 +41,15 @@ var ErrKeyFormat = errors.New("record key could not be parsed into peer ID")
// from the peer store
var
ErrPublicKeyNotFound
=
errors
.
New
(
"public key not found in peer store"
)
// NewIpnsRecordValidator returns a ValidChecker for IPNS records
// NewIpnsRecordValidator returns a ValidChecker for IPNS records
.
// The validator function will get a public key from the KeyBook
// to verify the record's signature
// to verify the record's signature. Note that the public key must
// already have been fetched from the network and put into the KeyBook
// by the caller.
func
NewIpnsRecordValidator
(
kbook
pstore
.
KeyBook
)
*
record
.
ValidChecker
{
// ValidateIpnsRecord implements ValidatorFunc and verifies that the
// given 'val' is an IpnsEntry and that that entry is valid.
// given record's value is an IpnsEntry, that the entry has been correctly
// signed, and that the entry has not expired
ValidateIpnsRecord
:=
func
(
r
*
record
.
ValidationRecord
)
error
{
if
r
.
Namespace
!=
"ipns"
{
return
ErrInvalidPath
...
...
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