Skip to content

Commit 8437cfe

Browse files
committed
context: deprecate support for encrypted TLS private keys
> Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since > it does not authenticate the ciphertext, it is vulnerable to padding oracle > attacks that can let an attacker recover the plaintext From https://go-review.googlesource.com/c/go/+/264159 > It's unfortunate that we don't implement PKCS#8 encryption so we can't > recommend an alternative but PEM encryption is so broken that it's worth > deprecating outright. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 15535d4) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 68a5ca8 commit 8437cfe

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

cli/command/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
255255
if tlsconfig.IsErrEncryptedKey(err) {
256256
passRetriever := passphrase.PromptRetrieverWithInOut(cli.In(), cli.Out(), nil)
257257
newClient := func(password string) (client.APIClient, error) {
258-
cli.dockerEndpoint.TLSPassword = password
258+
cli.dockerEndpoint.TLSPassword = password //nolint: staticcheck // SA1019: cli.dockerEndpoint.TLSPassword is deprecated
259259
return newAPIClientFromEndpoint(cli.dockerEndpoint, cli.configFile)
260260
}
261261
cli.client, err = getClientWithPassword(passRetriever, newClient)

cli/context/docker/load.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ type EndpointMeta = context.EndpointMetaBase
2626
// a Docker Engine endpoint, with its tls data
2727
type Endpoint struct {
2828
EndpointMeta
29-
TLSData *context.TLSData
29+
TLSData *context.TLSData
30+
31+
// Deprecated: Use of encrypted TLS private keys has been deprecated, and
32+
// will be removed in a future release. Golang has deprecated support for
33+
// legacy PEM encryption (as specified in RFC 1423), as it is insecure by
34+
// design (see https://go-review.googlesource.com/c/go/+/264159).
3035
TLSPassword string
3136
}
3237

docs/deprecated.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The table below provides an overview of the current status of deprecated feature
5050

5151
Status | Feature | Deprecated | Remove
5252
-----------|------------------------------------------------------------------------------------------------------------------------------------|------------|------------
53+
Deprecated | [Support for encrypted TLS private keys](#support-for-encrypted-tls-private-keys) | v20.10 | -
5354
Deprecated | [Kubernetes stack and context support](#kubernetes-stack-and-context-support) | v20.10 | -
5455
Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | -
5556
Deprecated | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | -
@@ -98,6 +99,15 @@ Removed | [`--api-enable-cors` flag on `dockerd`](#--api-enable-cors-flag-on-
9899
Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13
99100
Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12
100101

102+
### Support for encrypted TLS private keys
103+
104+
**Deprecated in Release: v20.10**
105+
106+
Use of encrypted TLS private keys has been deprecated, and will be removed in a
107+
future release. Golang has deprecated support for legacy PEM encryption (as
108+
specified in [RFC 1423](https://datatracker.ietf.org/doc/html/rfc1423)), as it
109+
is insecure by design (see [https://go-review.googlesource.com/c/go/+/264159](https://go-review.googlesource.com/c/go/+/264159)).
110+
101111
### Kubernetes stack and context support
102112

103113
**Deprecated in Release: v20.10**

0 commit comments

Comments
 (0)