diff --git a/commands/constructors.go b/commands/constructors.go index 0c7825f..4ffccfd 100644 --- a/commands/constructors.go +++ b/commands/constructors.go @@ -362,7 +362,7 @@ func CreatePutWrapkeyCommand(objID uint16, label []byte, domains uint16, capabil return command, nil } -func CreatePutAuthenticationKeyCommand(objID uint16, label []byte, domains uint16, capabilities, delegated uint64, encKey, macKey []byte) (*CommandMessage, error) { +func CreatePutAuthkeyCommand(objID uint16, label []byte, domains uint16, capabilities, delegated uint64, encKey, macKey []byte) (*CommandMessage, error) { if len(label) > LabelLength { return nil, errors.New("label is too long") } @@ -380,7 +380,7 @@ func CreatePutAuthenticationKeyCommand(objID uint16, label []byte, domains uint1 } command := &CommandMessage{ - CommandType: CommandTypePutAuthenticationKey, + CommandType: CommandTypePutAuthKey, } payload := bytes.NewBuffer([]byte{}) @@ -400,7 +400,7 @@ func CreatePutAuthenticationKeyCommand(objID uint16, label []byte, domains uint1 func CreatePutDerivedAuthenticationKeyCommand(objID uint16, label []byte, domains uint16, capabilities uint64, delegated uint64, password string) (*CommandMessage, error) { authKey := authkey.NewFromPassword(password) - return CreatePutAuthenticationKeyCommand(objID, label, domains, capabilities, delegated, authKey.GetEncKey(), authKey.GetMacKey()) + return CreatePutAuthkeyCommand(objID, label, domains, capabilities, delegated, authKey.GetEncKey(), authKey.GetMacKey()) } func CreateSignAttestationCertCommand(keyObjID, attestationObjID uint16) (*CommandMessage, error) { diff --git a/commands/response.go b/commands/response.go index 6a89d27..c2f6c60 100644 --- a/commands/response.go +++ b/commands/response.go @@ -92,7 +92,7 @@ type ( ObjectID uint16 } - PutAuthenticationKeyResponse struct { + PutAuthkeyResponse struct { ObjectID uint16 } @@ -167,8 +167,8 @@ func ParseResponse(data []byte) (Response, error) { return parseGetPseudoRandomResponse(payload), nil case CommandTypePutWrapKey: return parsePutWrapkeyResponse(payload) - case CommandTypePutAuthenticationKey: - return parsePutAuthenticationKeyResponse(payload) + case CommandTypePutAuthKey: + return parsePutAuthkeyResponse(payload) case CommandTypePutOpaque: return parsePutOpaqueResponse(payload) case CommandTypeGetOpaque: @@ -347,7 +347,7 @@ func parsePutWrapkeyResponse(payload []byte) (Response, error) { return &PutWrapkeyResponse{ObjectID: objectID}, nil } -func parsePutAuthenticationKeyResponse(payload []byte) (Response, error) { +func parsePutAuthkeyResponse(payload []byte) (Response, error) { if len(payload) != 2 { return nil, errors.New("invalid response payload length") } @@ -358,7 +358,7 @@ func parsePutAuthenticationKeyResponse(payload []byte) (Response, error) { return nil, err } - return &PutAuthenticationKeyResponse{ObjectID: objectID}, nil + return &PutAuthkeyResponse{ObjectID: objectID}, nil } func parsePutOpaqueResponse(payload []byte) (Response, error) { diff --git a/commands/types.go b/commands/types.go index 9bc55a5..ab76ada 100644 --- a/commands/types.go +++ b/commands/types.go @@ -23,7 +23,7 @@ const ( CommandTypeStorageStatus CommandType = 0x41 CommandTypePutOpaque CommandType = 0x42 CommandTypeGetOpaque CommandType = 0x43 - CommandTypePutAuthenticationKey CommandType = 0x44 + CommandTypePutAuthKey CommandType = 0x44 CommandTypePutAsymmetric CommandType = 0x45 CommandTypeGenerateAsymmetricKey CommandType = 0x46 CommandTypeSignDataPkcs1 CommandType = 0x47