mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-02 12:06:09 -04:00
attestation: add context to Issue and Validate methods (#1532)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
7c27d67953
commit
db5660e3d6
10 changed files with 43 additions and 34 deletions
|
@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
package watcher
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/asn1"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
@ -49,10 +50,10 @@ func NewValidator(log *logger.Logger, variant oid.Getter, fileHandler file.Handl
|
|||
}
|
||||
|
||||
// Validate calls the validators Validate method, and prevents any updates during the call.
|
||||
func (u *Updatable) Validate(attDoc []byte, nonce []byte) ([]byte, error) {
|
||||
func (u *Updatable) Validate(ctx context.Context, attDoc []byte, nonce []byte) ([]byte, error) {
|
||||
u.mux.Lock()
|
||||
defer u.mux.Unlock()
|
||||
return u.Validator.Validate(attDoc, nonce)
|
||||
return u.Validator.Validate(ctx, attDoc, nonce)
|
||||
}
|
||||
|
||||
// OID returns the validators Object Identifier.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue