Remove nonce encryption for workerAuth

This commit is contained in:
irenarindos committed 2022-06-06 11:20:04 -04:00
1 parent 4117841cf9
commit 4c55305a49
1 file changed
+2 -8
+2 -8
View File
@@ -125,6 +125,7 @@ func StoreNodeInformationTx(ctx context.Context, writer db.Writer, databaseWrapp
nodeAuth.WorkerKeyIdentifier = node.Id
nodeAuth.WorkerEncryptionPubKey = node.EncryptionPublicKeyBytes
nodeAuth.WorkerSigningPubKey = node.CertificatePublicKeyPkix
nodeAuth.Nonce = node.RegistrationNonce
var err error
nodeAuth.KeyId, err = databaseWrapper.KeyId(ctx)
@@ -135,10 +136,6 @@ func StoreNodeInformationTx(ctx context.Context, writer db.Writer, databaseWrapp
if err != nil {
return errors.Wrap(ctx, err, op)
}
nodeAuth.Nonce, err = encrypt(ctx, node.RegistrationNonce, databaseWrapper)
if err != nil {
return errors.Wrap(ctx, err, op)
}
// Get workerId from state passed in
var result workerAuthWorkerId
@@ -383,6 +380,7 @@ func (r *WorkerAuthRepositoryStorage) loadNodeInformation(ctx context.Context, n
node.EncryptionPublicKeyBytes = authorizedWorker.WorkerEncryptionPubKey
node.CertificatePublicKeyPkix = authorizedWorker.WorkerSigningPubKey
node.RegistrationNonce = authorizedWorker.Nonce
// Default values are used for key types
node.EncryptionPublicKeyType = types.KEYTYPE_X25519
@@ -398,10 +396,6 @@ func (r *WorkerAuthRepositoryStorage) loadNodeInformation(ctx context.Context, n
if err != nil {
return errors.Wrap(ctx, err, op)
}
node.RegistrationNonce, err = decrypt(ctx, authorizedWorker.Nonce, databaseWrapper)
if err != nil {
return errors.Wrap(ctx, err, op)
}
// Get cert bundles from the other table
certBundles, err := r.findCertBundles(ctx, node.Id)