From 3897b34431338bbc65c466adc209d9005488e66e Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Wed, 31 May 2023 19:29:57 +0200 Subject: [PATCH] Add support for WASI port 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 37f75e952b..3597172b59 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 0000000000..e5cf98e0af --- /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 +}