-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TSIG Verify/Generate using TsigProvider #1379
Conversation
- `tsig`: Expose `TsigVerifyProvider` and `TsigGenerateProvider` so that others can use these TSIG functions using a `TsigProvider`
I can't find a good reason to say 'no', so likely to be merged. as the function docs are now public, some comments there. |
1 similar comment
I can't find a good reason to say 'no', so likely to be merged. as the function docs are now public, some comments there. |
@@ -223,7 +225,9 @@ func TsigVerify(msg []byte, secret, requestMAC string, timersOnly bool) error { | |||
return tsigVerify(msg, tsigHMACProvider(secret), requestMAC, timersOnly, uint64(time.Now().Unix())) | |||
} | |||
|
|||
func tsigVerifyProvider(msg []byte, provider TsigProvider, requestMAC string, timersOnly bool) error { | |||
// TsigVerify verifies the TSIG on a message using a TsigProvider, for | |||
// more details and return see TsigVerify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comments isn't finished. 'for more details ... ?'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says see TsigVerify
(?)
} | ||
|
||
func tsigGenerateProvider(m *Msg, provider TsigProvider, requestMAC string, timersOnly bool) ([]byte, string, error) { | ||
// TsigGenerate fills out the TSIG record attached to the message using | ||
// a TsigProvider, for more details and return see TsigGenerate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also unfinished docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -166,10 +166,12 @@ type timerWireFmt struct { | |||
// timersOnly is false. | |||
// If something goes wrong an error is returned, otherwise it is nil. | |||
func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the docs - it's weirdly formatted, also Tsig RR -> TSIG RR..
"... called for the first time requestMAC should be set to the empty string and timersOnly should be false.":
would also be nice to tell what subsequent calls should look like,.
The "if something goes wrong an error is returned..." can be removed IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made no change in the documentation for that function.
The return of the functions are the same, do you really want duplicated documentation? |
Could anyone please let me know what kind of timeline I should expect for getting this merged and into a release? Just want to know so I can plan the release of my library that depends on this PR. |
@miekg Do you really want duplicated documentation? |
this lgtm although I'll close this and send in a new PR with that name in it and also adjust any docs |
OK.
It's totally okay for me if you push onto this branch also, it should be
open for you.
|
please double check for anything stupid |
Ah, must have misread that.
Ok..I'll push through a separate PR to clean that wording a bit.
…On Fri, 10 Jun 2022, 10:50 Jerry Lundström, ***@***.***> wrote:
The return of the functions are the same, do you really want duplicated
documentation?
—
Reply to this email directly, view it on GitHub
<#1379 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACWIW3DQPMN4TZIN2ZZT33VOL6UPANCNFSM5YJM4LIA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
By exposing
TsigVerifyProvider
andTsigGenerateProvider
functions I am able to fully implement TSIG support in DNS-OARC/golang-dns-server-doq similar to how it's done indns.Server
and without needed to copy almost all oftsig.go
.I see no harm in exposing these functions and maybe others will find them useful also, hope it can be merged.