Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.23

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
env:
CGO_ENABLED: "0"

build_windows:
runs-on: windows-latest
Expand All @@ -32,10 +34,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.23

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
env:
CGO_ENABLED: "0"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ vmextension/testdir/
vendor/
pkg/utils/configTemp/
pkg/utils/downloadTemp/
pkg/settings/testdir/
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"go.testEnvVars": {
"CGO_ENABLED": "0"
}
}
7 changes: 4 additions & 3 deletions pkg/encrypt/encrypt_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ package encrypt
import (
"encoding/hex"
"fmt"
"github.com/Azure/azure-extension-platform/pkg/internal/crypto"
"golang.org/x/sys/windows"
"syscall"
"unsafe"

"github.com/Azure/azure-extension-platform/pkg/internal/crypto"
"golang.org/x/sys/windows"
)

const (
Expand All @@ -30,7 +31,7 @@ func (cHandler *certHandler) GetThumbprint() (certThumbprint string, err error)

func (cHandler *certHandler) Encrypt(bytesToEncrypt []byte) (encryptedBytes []byte, err error) {
alg := szOID_RSA_RC4
buffer := []byte(alg)
buffer := append([]byte(alg), 0) // null-terminate for the C API
procCryptEncryptMessage := crypto.Modcrypt32.NewProc("CryptEncryptMessage")
cai := crypto.CryptAlgorithmIdentifier{
PszObjID: uintptr(unsafe.Pointer(&buffer[0])),
Expand Down