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
|
|
@ -84,7 +84,7 @@ CREATE TABLE IF NOT EXISTS teams(
|
|||
}
|
||||
if _, err := db.Exec(`
|
||||
CREATE TABLE IF NOT EXISTS certificates(
|
||||
id_cert BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
id_cert BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
creation TIMESTAMP NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
id_team INTEGER NULL,
|
||||
|
|
|
|||
Reference in a new issue