[go: up one dir, main page]

Skip to content
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

Merged
merged 71 commits into from
Jan 21, 2020
Merged

Release/v0.6.0 #252

merged 71 commits into from
Jan 21, 2020

Conversation

iyangsj
Copy link
Member
@iyangsj iyangsj commented Jan 21, 2020

No description provided.


import (
"bytes"
"crypto/md5"

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

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"

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")))

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"))))

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)

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),

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)

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)

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)

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)

@iyangsj iyangsj merged commit a5e0df5 into master Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.