• 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
..
pkix Loading commit data...
cert_pool.go Loading commit data...
example_test.go Loading commit data...
pem_decrypt.go Loading commit data...
pem_decrypt_test.go Loading commit data...
pkcs1.go Loading commit data...
pkcs8.go Loading commit data...
pkcs8_test.go Loading commit data...
root.go Loading commit data...
root_cgo_darwin.go Loading commit data...
root_darwin.go Loading commit data...
root_darwin_test.go Loading commit data...
root_nocgo_darwin.go Loading commit data...
root_plan9.go Loading commit data...
root_unix.go Loading commit data...
root_windows.go Loading commit data...
sec1.go Loading commit data...
sec1_test.go Loading commit data...
verify.go Loading commit data...
verify_test.go Loading commit data...
x509.go Loading commit data...
x509_test.go Loading commit data...
x509_test_import.go Loading commit data...