pki: improve serial number generation + fix team association
Replace math/rand by crypto/rand. Fix big when associating certificate with leading zero: nginx prepend 0 wherehas we don't.
This commit is contained in:
parent
3ed8c619b1
commit
68e5c4cd2b
5 changed files with 37 additions and 18 deletions
|
|
@ -282,7 +282,7 @@ func fileHandler(f func(fic.EFile,[]byte) (interface{}, error)) func (httprouter
|
|||
|
||||
func certificateHandler(f func(fic.Certificate,[]byte) (interface{}, error)) func (httprouter.Params,[]byte) (interface{}, error) {
|
||||
return func (ps httprouter.Params, body []byte) (interface{}, error) {
|
||||
if certid, err := strconv.ParseInt(string(ps.ByName("certid")), 10, 64); err != nil {
|
||||
if certid, err := strconv.ParseUint(string(ps.ByName("certid")), 10, 64); err != nil {
|
||||
return nil, err
|
||||
} else if cert, err := fic.GetCertificate(certid); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Reference in a new issue