• Alex Brainman's avatar
    syscall: introduce Pointer type and use it instead of uintptr · 4869ec00
    Alex Brainman authored
    Some syscall structures used by crypto/x509 have uintptr
    fields that store pointers. These pointers are set with
    a pointer to another Go structure. But the pointers are
    not visible by garbage collector, and GC does not update
    the fields after they were set. So when structure with
    invalid uintptr pointers passed to Windows, we get
    memory corruption.
    
    This CL 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.
    
    As suggested by Austin Clements.
    
    Fixes #21376
    Updates #24820
    
    Change-Id: If95cd9eee3c69e4cfc35b7b25b1b40c2dc8f0df7
    Reviewed-on: https://go-review.googlesource.com/106275Reviewed-by: 's avatarAustin Clements <austin@google.com>
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    4869ec00
Name
Last commit
Last update
..
aes Loading commit data...
cipher Loading commit data...
des Loading commit data...
dsa Loading commit data...
ecdsa Loading commit data...
elliptic Loading commit data...
hmac Loading commit data...
internal/cipherhw Loading commit data...
md5 Loading commit data...
rand Loading commit data...
rc4 Loading commit data...
rsa Loading commit data...
sha1 Loading commit data...
sha256 Loading commit data...
sha512 Loading commit data...
subtle Loading commit data...
tls Loading commit data...
x509 Loading commit data...
crypto.go Loading commit data...
issue21104_test.go Loading commit data...