mirror of
https://github.com/google/go-attestation.git
synced 2025-06-23 00:49:17 +00:00
Remove certificate-transparency-go dependancy
Signed-off-by: Joe Richey <joerichey@google.com>
This commit is contained in:
committed by
Joseph Richey
parent
0a9ecdcf7c
commit
03018e6828
@ -28,11 +28,10 @@ import (
|
|||||||
"crypto/elliptic"
|
"crypto/elliptic"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"crypto/x509"
|
||||||
"encoding/asn1"
|
"encoding/asn1"
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSimTPM20KeyCreateAndLoad(t *testing.T) {
|
func TestSimTPM20KeyCreateAndLoad(t *testing.T) {
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"crypto/x509"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
@ -15,7 +16,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
"github.com/google/go-attestation/attest"
|
"github.com/google/go-attestation/attest"
|
||||||
"github.com/google/go-attestation/attest/attest-tool/internal"
|
"github.com/google/go-attestation/attest/attest-tool/internal"
|
||||||
)
|
)
|
||||||
|
@ -17,12 +17,12 @@ package attest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto"
|
"crypto"
|
||||||
|
"crypto/x509"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
"github.com/google/go-tpm/tpm"
|
"github.com/google/go-tpm/tpm"
|
||||||
"github.com/google/go-tpm/tpm2"
|
"github.com/google/go-tpm/tpm2"
|
||||||
)
|
)
|
||||||
|
@ -4,9 +4,8 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"crypto/x509"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMakeActivationBlob(t *testing.T) {
|
func TestMakeActivationBlob(t *testing.T) {
|
||||||
|
@ -2,14 +2,13 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/x509"
|
||||||
|
"encoding/asn1"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"unicode/utf16"
|
"unicode/utf16"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/asn1"
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -19,14 +19,13 @@ package attest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/x509"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
|
|
||||||
"github.com/google/go-tpm/tpmutil"
|
"github.com/google/go-tpm/tpmutil"
|
||||||
tpmtbs "github.com/google/go-tpm/tpmutil/tbs"
|
tpmtbs "github.com/google/go-tpm/tpmutil/tbs"
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
|
@ -16,10 +16,10 @@ package attest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/x509"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
"github.com/google/go-attestation/attest/internal"
|
"github.com/google/go-attestation/attest/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,15 +18,14 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"crypto/x509"
|
||||||
|
"encoding/asn1"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/asn1"
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
|
|
||||||
"github.com/google/go-tpm/tpm2"
|
"github.com/google/go-tpm/tpm2"
|
||||||
"github.com/google/go-tpm/tpmutil"
|
"github.com/google/go-tpm/tpmutil"
|
||||||
)
|
)
|
||||||
@ -199,12 +198,12 @@ func ParseEKCertificate(ekCert []byte) (*x509.Certificate, error) {
|
|||||||
var cert struct {
|
var cert struct {
|
||||||
Raw asn1.RawContent
|
Raw asn1.RawContent
|
||||||
}
|
}
|
||||||
if _, err := asn1.UnmarshalWithParams(ekCert, &cert, "lax"); err != nil && x509.IsFatal(err) {
|
if _, err := asn1.UnmarshalWithParams(ekCert, &cert, "lax"); err != nil {
|
||||||
return nil, fmt.Errorf("asn1.Unmarshal() failed: %v, wasWrapped=%v", err, wasWrapped)
|
return nil, fmt.Errorf("asn1.Unmarshal() failed: %v, wasWrapped=%v", err, wasWrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
c, err := x509.ParseCertificate(cert.Raw)
|
c, err := x509.ParseCertificate(cert.Raw)
|
||||||
if err != nil && x509.IsFatal(err) {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("x509.ParseCertificate() failed: %v", err)
|
return nil, fmt.Errorf("x509.ParseCertificate() failed: %v", err)
|
||||||
}
|
}
|
||||||
return c, nil
|
return c, nil
|
||||||
|
@ -19,11 +19,11 @@ package attest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto"
|
"crypto"
|
||||||
|
"crypto/x509"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
"github.com/google/go-tspi/attestation"
|
"github.com/google/go-tspi/attestation"
|
||||||
"github.com/google/go-tspi/tspi"
|
"github.com/google/go-tspi/tspi"
|
||||||
"github.com/google/go-tspi/tspiconst"
|
"github.com/google/go-tspi/tspiconst"
|
||||||
|
@ -2,11 +2,10 @@ package attest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"crypto/x509"
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generated using the following command:
|
// Generated using the following command:
|
||||||
|
@ -19,12 +19,12 @@ import (
|
|||||||
"crypto"
|
"crypto"
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
|
"encoding/asn1"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/asn1"
|
|
||||||
"github.com/google/go-tpm/tpm2"
|
"github.com/google/go-tpm/tpm2"
|
||||||
"github.com/google/go-tpm/tpmutil"
|
"github.com/google/go-tpm/tpmutil"
|
||||||
)
|
)
|
||||||
|
@ -9,15 +9,15 @@ package attributecert
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto"
|
"crypto"
|
||||||
|
"crypto/x509"
|
||||||
|
"crypto/x509/pkix"
|
||||||
|
"encoding/asn1"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-attestation/oid"
|
"github.com/google/go-attestation/oid"
|
||||||
"github.com/google/certificate-transparency-go/asn1"
|
|
||||||
"github.com/google/certificate-transparency-go/x509/pkix"
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -15,13 +15,12 @@
|
|||||||
package attributecert
|
package attributecert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/x509"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/certificate-transparency-go/x509"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVerifyAttributeCert(t *testing.T) {
|
func TestVerifyAttributeCert(t *testing.T) {
|
||||||
|
1
go.mod
1
go.mod
@ -3,7 +3,6 @@ module github.com/google/go-attestation
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/certificate-transparency-go v1.1.1
|
|
||||||
github.com/google/go-cmp v0.5.7
|
github.com/google/go-cmp v0.5.7
|
||||||
github.com/google/go-tpm v0.3.3
|
github.com/google/go-tpm v0.3.3
|
||||||
github.com/google/go-tpm-tools v0.3.1
|
github.com/google/go-tpm-tools v0.3.1
|
||||||
|
Reference in New Issue
Block a user