• Adam Langley's avatar
    crypto/x509: continue to recognise MaxPathLen of zero as "no value". · 64bed3f5
    Adam Langley authored
    In [1] the behaviour of encoding/asn1 with respect to marshaling
    optional integers was changed. Previously, a zero valued integer would
    be omitted when marshaling. After the change, if a default value was
    set then the integer would only be omitted if it was the default value.
    
    This changed the behaviour of crypto/x509 because
    Certificate.MaxPathLen has a default value of -1 and thus zero valued
    MaxPathLens would no longer be omitted when marshaling. This is
    arguably a bug-fix -- a value of zero for MaxPathLen is valid and
    meaningful and now could be expressed. However it broke users
    (including Docker) who were not setting MaxPathLen at all.
    
    This change again causes a zero-valued MaxPathLen to be omitted and
    introduces a ZeroMathPathLen member that indicates that, yes, one
    really does want a zero. This is ugly, but we value not breaking users.
    
    [1] https://code.google.com/p/go/source/detail?r=4218b3544610e8d9771b89126553177e32687adf
    
    LGTM=rsc
    R=rsc
    CC=golang-codereviews, golang-dev
    https://golang.org/cl/153420045
    64bed3f5
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...
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...