Commit 028c70db authored by Sietse Ringers's avatar Sietse Ringers
Browse files

refactor: make keyshare server JWT signing key ID an uint32 for consistency with AES key IDs

parent 380b9f33
......@@ -21,7 +21,7 @@ type (
// Key used to sign keyshare protocol messages
signKey *rsa.PrivateKey
signKeyID int
signKeyID uint32
// Commit values generated in first step of keyshare protocol
commitmentData map[uint64]*big.Int
......@@ -33,7 +33,7 @@ type (
}
)
func NewKeyshareCore(aesKeyID uint32, aesKey AesKey, signKeyID int, signKey *rsa.PrivateKey) *Core {
func NewKeyshareCore(aesKeyID uint32, aesKey AesKey, signKeyID uint32, signKey *rsa.PrivateKey) *Core {
c := &Core{
decryptionKeys: map[uint32]AesKey{},
commitmentData: map[uint64]*big.Int{},
......@@ -66,7 +66,7 @@ func (c *Core) setAESEncryptionKey(keyID uint32, key AesKey) {
}
// Set key used to sign keyshare protocol messages
func (c *Core) setSignKey(id int, key *rsa.PrivateKey) {
func (c *Core) setSignKey(id uint32, key *rsa.PrivateKey) {
c.signKey = key
c.signKeyID = id
}
......
......@@ -220,7 +220,7 @@ func configureKeyshared(cmd *cobra.Command) {
DBType: keyshareserver.DatabaseType(viper.GetString("db-type")),
DBConnstring: viper.GetString("db"),
JwtKeyID: viper.GetInt("jwt-privkey-id"),
JwtKeyID: viper.GetUint32("jwt-privkey-id"),
JwtPrivateKey: viper.GetString("jwt-privkey"),
JwtPrivateKeyFile: viper.GetString("jwt-privkey-file"),
StoragePrimaryKeyFile: viper.GetString("storage-primary-keyfile"),
......
......@@ -58,7 +58,7 @@ type Configuration struct {
// Configuration of secure Core
// Private key used to sign JWTs with
JwtKeyID int `json:"jwt_key_id" mapstructure:"jwt_key_id"`
JwtKeyID uint32 `json:"jwt_key_id" mapstructure:"jwt_key_id"`
JwtPrivateKey string `json:"jwt_privkey" mapstructure:"jwt_privkey"`
JwtPrivateKeyFile string `json:"jwt_privkey_file" mapstructure:"jwt_privkey_file"`
// Decryption keys used for keyshare packets
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment