-
Notifications
You must be signed in to change notification settings - Fork 949
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
Release/v0.6.0 #252
Release/v0.6.0 #252
Conversation
Change afterAccept to sessionIdHandler Change beforeLocation to requestIdHandler
|
||
import ( | ||
"bytes" | ||
"crypto/md5" |
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.
G501: Blacklisted import crypto/md5
: weak cryptographic primitive (from gosec
)
} | ||
|
||
// caculate signature | ||
return AccessSign(md5.Sum(data)), nil |
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.
G401: Use of weak cryptographic primitive (from gosec
)
package mod_prison | ||
|
||
import ( | ||
"crypto/md5" |
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.
G501: Blacklisted import crypto/md5
: weak cryptographic primitive (from gosec
)
} | ||
rule.initDict(nil) | ||
|
||
sign := AccessSign(md5.Sum([]byte("12334"))) |
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.
G401: Use of weak cryptographic primitive (from gosec
)
} | ||
|
||
// should get failed | ||
value, ok = rule.accessDict.Get(AccessSign(md5.Sum([]byte("1234")))) |
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.
G401: Use of weak cryptographic primitive (from gosec
)
// PrisonRuleListCheck check prisonRuleList | ||
func PrisonRuleListCheck(conf *PrisonRuleConfList) error { | ||
// create a rule map | ||
ruleMap := make(map[string]bool, 0) |
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.
S1019: should use make(map[string]bool) instead (from gosimple
)
|
||
func newProductRuleTable() *productRuleTable { | ||
return &productRuleTable{ | ||
ruleTable: make(map[string]*prisonRules, 0), |
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.
S1019: should use make(map[string]*prisonRules) instead (from gosimple
)
func (p *productRuleTable) newRuleTable(config ProductRuleConf) (map[string]*prisonRules, error) { | ||
oldRuleTable := p.getTable() | ||
|
||
ruleTable := make(map[string]*prisonRules, 0) |
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.
S1019: should use make(map[string]*prisonRules) instead (from gosimple
)
} | ||
|
||
func (r *prisonRules) initDict(oldRules *prisonRules) { | ||
oldRuleMap := make(map[string]*prisonRule, 0) |
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.
S1019: should use make(map[string]*prisonRule) instead (from gosimple
)
ipLocTable.LocLen = LocLen | ||
ipLocTable.locations = make([]byte, (HEADER_LEN+LocLen)*maxSize, (HEADER_LEN+LocLen)*maxSize) | ||
ipLocTable.LocLen = locLen | ||
ipLocTable.locations = make([]byte, (HEADER_LEN+locLen)*maxSize, (HEADER_LEN+locLen)*maxSize) |
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.
S1019: should use make([]byte, (HEADER_LEN + locLen) * maxSize) instead (from gosimple
)
No description provided.