Skip to content

Commit a1e8f74

Browse files
committed
Drop dependency on github.com/intel-go/cpuid
Signed-off-by: Akihiro Suda <[email protected]>
1 parent ef0f698 commit a1e8f74

File tree

8 files changed

+9
-87
lines changed

8 files changed

+9
-87
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ require (
2121
github.com/google/go-cmp v0.5.9
2222
github.com/gorilla/mux v1.8.0
2323
github.com/hashicorp/go-multierror v1.1.1
24-
github.com/intel-go/cpuid v0.0.0-20220614022739-219e067757cb
2524
github.com/lima-vm/sshocker v0.3.1
2625
github.com/mattn/go-isatty v0.0.17
2726
github.com/mattn/go-shellwords v1.0.12

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,6 @@ github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7P
348348
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
349349
github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f h1:l1QCwn715k8nYkj4Ql50rzEog3WnMdrd4YYMMwemxEo=
350350
github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f/go.mod h1:h+MxyHxRg9NH3terB1nfRIUaQEcI0XOVkdR9LNBlp8E=
351-
github.com/intel-go/cpuid v0.0.0-20220614022739-219e067757cb h1:Fg0Y/RDZ6UPwl3o7/IzPbneDq8g9+gH6DPs42KFUsy8=
352-
github.com/intel-go/cpuid v0.0.0-20220614022739-219e067757cb/go.mod h1:RmeVYf9XrPRbRc3XIx0gLYA8qOFvNoPOfaEZduRlEp4=
353351
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
354352
github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw=
355353
github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ=

pkg/sshutil/sshutil.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/lima-vm/lima/pkg/store/dirnames"
2121
"github.com/lima-vm/lima/pkg/store/filenames"
2222
"github.com/sirupsen/logrus"
23+
"golang.org/x/sys/cpu"
2324
)
2425

2526
type PubKey struct {
@@ -294,3 +295,11 @@ func detectValidPublicKey(content string) bool {
294295
var sigFormat = string(decodedKey[4 : 4+sigLength])
295296
return algo == sigFormat
296297
}
298+
299+
func detectAESAcceleration() bool {
300+
if !cpu.Initialized {
301+
logrus.Warn("Failed to detect CPU features. Assuming that AES acceleration is not available.")
302+
return false
303+
}
304+
return cpu.ARM.HasAES || cpu.ARM64.HasAES || cpu.S390X.HasAES || cpu.X86.HasAES
305+
}

pkg/sshutil/sshutil_darwin.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

pkg/sshutil/sshutil_linux.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

pkg/sshutil/sshutil_others.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

pkg/sshutil/sshutil_windows_amd64.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

pkg/sshutil/sshutil_windows_arm64.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)