Commit 6c888cc5 authored by Alex Brainman's avatar Alex Brainman

windows: replace uintptr in crypto structs

This CL is a copy of CL 106275 (see CL 106275 for details).

It introduces CertInfo, CertTrustListInfo and CertRevocationCrlInfo
types. It uses pointers to new types instead of uintptr in CertContext,
CertSimpleChain and CertRevocationInfo.

CertRevocationInfo, CertChainPolicyPara and CertChainPolicyStatus types
have uintptr field that can be pointer to many different things
(according to Windows API). So this CL introduces Pointer type to be
used for those cases.

Fixes golang/go#25797

Change-Id: I7797ddc6daf3e67b7eab69ab9fbf4d51650f8b6a
Reviewed-on: https://go-review.googlesource.com/118797Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 8014b7b1
......@@ -312,6 +312,14 @@ var (
OID_SGC_NETSCAPE = []byte("2.16.840.1.113730.4.1\x00")
)
// Pointer represents a pointer to an arbitrary Windows type.
//
// Pointer-typed fields may point to one of many different types. It's
// up to the caller to provide a pointer to the appropriate type, cast
// to Pointer. The caller must obey the unsafe.Pointer rules while
// doing so.
type Pointer *struct{}
// Invented values to support what package os expects.
type Timeval struct {
Sec int32
......@@ -880,11 +888,15 @@ type MibIfRow struct {
Descr [MAXLEN_IFDESCR]byte
}
type CertInfo struct {
// Not implemented
}
type CertContext struct {
EncodingType uint32
EncodedCert *byte
Length uint32
CertInfo uintptr
CertInfo *CertInfo
Store Handle
}
......@@ -899,12 +911,16 @@ type CertChainContext struct {
RevocationFreshnessTime uint32
}
type CertTrustListInfo struct {
// Not implemented
}
type CertSimpleChain struct {
Size uint32
TrustStatus CertTrustStatus
NumElements uint32
Elements **CertChainElement
TrustListInfo uintptr
TrustListInfo *CertTrustListInfo
HasRevocationFreshnessTime uint32
RevocationFreshnessTime uint32
}
......@@ -919,14 +935,18 @@ type CertChainElement struct {
ExtendedErrorInfo *uint16
}
type CertRevocationCrlInfo struct {
// Not implemented
}
type CertRevocationInfo struct {
Size uint32
RevocationResult uint32
RevocationOid *byte
OidSpecificInfo uintptr
OidSpecificInfo Pointer
HasFreshnessTime uint32
FreshnessTime uint32
CrlInfo uintptr // *CertRevocationCrlInfo
CrlInfo *CertRevocationCrlInfo
}
type CertTrustStatus struct {
......@@ -957,7 +977,7 @@ type CertChainPara struct {
type CertChainPolicyPara struct {
Size uint32
Flags uint32
ExtraPolicyPara uintptr
ExtraPolicyPara Pointer
}
type SSLExtraCertChainPolicyPara struct {
......@@ -972,7 +992,7 @@ type CertChainPolicyStatus struct {
Error uint32
ChainIndex uint32
ElementIndex uint32
ExtraPolicyStatus uintptr
ExtraPolicyStatus Pointer
}
const (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment