mirror of
https://github.com/google/go-attestation.git
synced 2024-12-18 20:47:57 +00:00
Revert WIP fuzzing work
This commit is contained in:
parent
58786a4742
commit
74a97ba02f
@ -1,5 +1,3 @@
|
||||
// +build !gofuzz
|
||||
|
||||
package attest
|
||||
|
||||
import (
|
||||
@ -33,6 +31,21 @@ const (
|
||||
tpm20GeneratedMagic = 0xff544347
|
||||
)
|
||||
|
||||
func cryptoHash(h tpm2.Algorithm) (crypto.Hash, error) {
|
||||
switch h {
|
||||
case tpm2.AlgSHA1:
|
||||
return crypto.SHA1, nil
|
||||
case tpm2.AlgSHA256:
|
||||
return crypto.SHA256, nil
|
||||
case tpm2.AlgSHA384:
|
||||
return crypto.SHA384, nil
|
||||
case tpm2.AlgSHA512:
|
||||
return crypto.SHA512, nil
|
||||
default:
|
||||
return crypto.Hash(0), fmt.Errorf("unsupported signature digest: %v", h)
|
||||
}
|
||||
}
|
||||
|
||||
// ActivationParameters encapsulates the inputs for activating an AIK.
|
||||
type ActivationParameters struct {
|
||||
// TPMVersion holds the version of the TPM, either 1.2 or 2.0.
|
||||
|
@ -1,22 +0,0 @@
|
||||
package attest
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
"fmt"
|
||||
"github.com/google/go-tpm/tpm2"
|
||||
)
|
||||
|
||||
func cryptoHash(h tpm2.Algorithm) (crypto.Hash, error) {
|
||||
switch h {
|
||||
case tpm2.AlgSHA1:
|
||||
return crypto.SHA1, nil
|
||||
case tpm2.AlgSHA256:
|
||||
return crypto.SHA256, nil
|
||||
case tpm2.AlgSHA384:
|
||||
return crypto.SHA384, nil
|
||||
case tpm2.AlgSHA512:
|
||||
return crypto.SHA512, nil
|
||||
default:
|
||||
return crypto.Hash(0), fmt.Errorf("unsupported signature digest: %v", h)
|
||||
}
|
||||
}
|
@ -13,7 +13,6 @@
|
||||
// the License.
|
||||
|
||||
// +build linux
|
||||
// +build !gofuzz
|
||||
|
||||
package attest
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
// License for the specific language governing permissions and limitations under
|
||||
// the License.
|
||||
|
||||
// +build windows !cgo
|
||||
// +build windows
|
||||
|
||||
package attest
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"github.com/google/go-attestation/attest"
|
||||
)
|
||||
|
||||
func FuzzParseEventLog(data []byte) int {
|
||||
attest.ParseEventLog(data)
|
||||
return 0
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
// the License.
|
||||
|
||||
// +build linux
|
||||
// +build !gofuzz
|
||||
|
||||
package attest
|
||||
|
||||
|
@ -1,61 +0,0 @@
|
||||
// Copyright 2019 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
// use this file except in compliance with the License. You may obtain a copy of
|
||||
// the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
// License for the specific language governing permissions and limitations under
|
||||
// the License.
|
||||
|
||||
// +build gofuzz
|
||||
|
||||
package attest
|
||||
|
||||
type platformTPM struct {
|
||||
}
|
||||
|
||||
func probeSystemTPMs() ([]probedTPM, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func openTPM(tpm probedTPM) (*TPM, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) tpmVersion() TPMVersion {
|
||||
return TPMVersionAgnostic
|
||||
}
|
||||
|
||||
func (t *platformTPM) close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) info() (*TPMInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) loadAIK(opaqueBlob []byte) (*AIK, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) eks() ([]EK, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) newAIK(opts *AIKConfig) (*AIK, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) pcrs(alg HashAlg) ([]PCR, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (t *platformTPM) measurementLog() ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user