From d1de4374fd0efc92b9cf786ac548a6f8f375fd40 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Thu, 1 Jun 2023 10:29:14 +0200 Subject: [PATCH] Add support for WASI port (#1089) Fix building when the new `wasip1` port is being used. This is a new target that will be introduced by go 1.21. For more details https://github.com/golang/go/issues/58141 Signed-off-by: Flavio Castelli --- CHANGELOG.md | 3 +++ x509/root_wasip1.go | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 x509/root_wasip1.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f75e952b2..3597172b59c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## HEAD +### Add support for WASI port +* Add build tags for wasip1 GOOS + ### Add support for IBM Z operating system z/OS * Add build tags for zos diff --git a/x509/root_wasip1.go b/x509/root_wasip1.go new file mode 100644 index 00000000000..e5cf98e0af0 --- /dev/null +++ b/x509/root_wasip1.go @@ -0,0 +1,19 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build wasip1 +// +build wasip1 + +package x509 + +// Possible certificate files; stop after finding one. +var certFiles = []string{} + +func loadSystemRoots() (*CertPool, error) { + return NewCertPool(), nil +} + +func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { + return nil, nil +}