Skip to content

Commit eb00193

Browse files
committed
Merge branch 'kuba/ssh/license_compliance4/OTP-19743' into maint
* kuba/ssh/license_compliance4/OTP-19743: ssh: licenses in doc folder ssh: licenses in test folder ssh: add test suites categories (by Hans) to internal_doc ssh: copy ssh_basic_SUITE keys into ssh_sftpd_SUITE ssh: ssh_file license parsing fix
2 parents 634298a + 3c9e935 commit eb00193

File tree

453 files changed

+8299
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+8299
-27
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%%
2+
%% %CopyrightBegin%
3+
%%
4+
%% SPDX-License-Identifier: Apache-2.0
5+
%%
6+
%% Copyright Ericsson AB 2004-2025. All Rights Reserved.
7+
%%
8+
%% Licensed under the Apache License, Version 2.0 (the "License");
9+
%% you may not use this file except in compliance with the License.
10+
%% You may obtain a copy of the License at
11+
%%
12+
%% http://www.apache.org/licenses/LICENSE-2.0
13+
%%
14+
%% Unless required by applicable law or agreed to in writing, software
15+
%% distributed under the License is distributed on an "AS IS" BASIS,
16+
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
%% See the License for the specific language governing permissions and
18+
%% limitations under the License.
19+
%%
20+
%% %CopyrightEnd%
21+
%%
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%%
2+
%% %CopyrightBegin%
3+
%%
4+
%% SPDX-License-Identifier: Apache-2.0
5+
%%
6+
%% Copyright Ericsson AB 2004-2025. All Rights Reserved.
7+
%%
8+
%% Licensed under the Apache License, Version 2.0 (the "License");
9+
%% you may not use this file except in compliance with the License.
10+
%% You may obtain a copy of the License at
11+
%%
12+
%% http://www.apache.org/licenses/LICENSE-2.0
13+
%%
14+
%% Unless required by applicable law or agreed to in writing, software
15+
%% distributed under the License is distributed on an "AS IS" BASIS,
16+
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
%% See the License for the specific language governing permissions and
18+
%% limitations under the License.
19+
%%
20+
%% %CopyrightEnd%
21+
%%

lib/ssh/internal_doc/ssh_notes.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,34 @@ flowchart RL
164164
end
165165
end
166166
```
167+
# Test Suites Overview
168+
## Crypto algorithms
169+
ssh_algorithms_SUITE (all algorithms against installed OpenSSH and self)
170+
ssh_compat_SUITE (all algorithms against different OpenSSH by using them)
171+
## Key handling
172+
ssh_pubkey_SUITE
173+
ssh_basic_SUITE
174+
ssh_algorithms_SUITE
175+
ssh_comp_SUITE
176+
ssh_engine_SUITE
177+
ssh_agent_SUITE + ssh_agent_mock_server (Keys in an (mock) agent)
178+
## Protocol (error behaviour)
179+
ssh_protocol_SUITE (contains a minimal ssh that injects errors and hard-to-test stuff)
180+
ssh_comp_SUITE
181+
## Compatibility
182+
ssh_comp_SUITE (Tests towards dockers with different OpenSSH versions)
183+
## Channels
184+
ssh_chan_behaviours_SUITE
185+
ssh_basic_SUITE (shell, cli, key callback mechanism)
186+
ssh_connection_SUITE
187+
ssh_sftp_SUITE
188+
ssh_sftpd_SUITE
189+
## Perseverance
190+
ssh_property_test_SUITE (lib/ssh/test/property_test/ssh_eqc_*)
191+
## Misc
192+
ssh_agents_SUITE
193+
ssh_to_openssh_SUITE ( tcp-forwarding)
194+
ssh_dbg_SUITE
195+
ssh_sup_SUITE
196+
ssh_upgrade_SUITE (broken)
197+
ssh_options_SUITE

lib/ssh/src/ssh_file.erl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,18 @@ decode(KeyBin, ssh2_pubkey) when is_binary(KeyBin) ->
490490
ssh_message:ssh2_pubkey_decode(KeyBin);
491491

492492
decode(KeyBin, public_key) when is_binary(KeyBin) ->
493-
Type = case KeyBin of
494-
<<"-----BEGIN OPENSSH",_/binary>> -> openssh_key_v1;
495-
<<"----",_/binary>> -> rfc4716_key;
496-
_ -> openssh_key
497-
end,
493+
Matches = fun(Bin, Pattern, Type) ->
494+
case binary:match(Bin, Pattern) of
495+
nomatch -> false;
496+
_ -> Type
497+
end
498+
end,
499+
Type =
500+
maybe
501+
false ?= Matches(KeyBin, <<"\n-----BEGIN OPENSSH">>, openssh_key_v1),
502+
false ?= Matches(KeyBin, <<"\n----">>, rfc4716_key),
503+
openssh_key
504+
end,
498505
decode(KeyBin, Type);
499506

500507
decode(KeyBin, Type) when is_binary(KeyBin) andalso
@@ -1172,7 +1179,7 @@ decode_ssh_file(PrivPub, Algorithm, Pem, Password) ->
11721179

11731180

11741181
decode_pem_keys(RawBin, Password) ->
1175-
PemLines = split_in_lines(
1182+
PemLines = split_in_nonempty_lines(
11761183
binary:replace(RawBin, [<<"\\\n">>,<<"\\\r\\\n">>], <<"">>, [global])
11771184
),
11781185
decode_pem_keys(PemLines, Password, []).

lib/ssh/test/property_test/README

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
19+
120

221
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322
%%% %%%

lib/ssh/test/property_test/ssh_eqc_client_server_dirs/id_dsa

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
119
-----BEGIN DSA PRIVATE KEY-----
220
MIIBuwIBAAKBgQDIywHurUpOq6kZuMn+XlRzR4hAxF6qwSkuEqkV7iHnLQ0kIwf3
321
uAmjFDhuEsQ8653SLxGVvTNp+KFFgDXiLqgM7TPUwDnpbvzEZHPAU+/zPt4sdY2D
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
119
ssh-dss AAAAB3NzaC1kc3MAAACBAMjLAe6tSk6rqRm4yf5eVHNHiEDEXqrBKS4SqRXuIectDSQjB/e4CaMUOG4SxDzrndIvEZW9M2n4oUWANeIuqAztM9TAOelu/MRkc8BT7/M+3ix1jYO3EF8nBPZIWUroc87E5zF0O4P79rn2yHyGT9hU5TtlNwFWxUbwai3hRwXlAAAAFQDxnQjw0Ckk5T4jPTsAQdfvaddZOQAAAIBEvHDiXXuYRP1xTS5/g+l7mewJs4Mm/jhmtKymJy/KkZUustw3kpZube+NEUJDksW6cAbcXAsLZKHQIfpN6agh9E+xEdHvC+kEZ2tzr3dSUw6Kz+Zya80xADO5A1b1avF3Oy9ZH+vmzo0QdaopQkZdI+LZ34iOr+YI6YiHMvPKIAAAAIEAsTRcHZqZlamr0PM7jKt2edCpcd8rEFGtWuescebc6Ga5JGSv7Ue4cdYKpAjT10Mns1WYaU9t6ZR+6ARP7DkzzDmS1elwkRu21T+b81PmeZwaEJxgqr+CROQVHgzpqMqEx8ic3c/juxZpRrCAlRCjCWSJLDMobBQvtfyG0qsleNg= uabhnil@elxadlj3q32

lib/ssh/test/property_test/ssh_eqc_client_server_dirs/id_ecdsa256

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
119
-----BEGIN EC PRIVATE KEY-----
220
MHcCAQEEIJfCaBKIIKhjbJl5F8BedqlXOQYDX5ba9Skypllmx/w+oAoGCCqGSM49
321
AwEHoUQDQgAE49RbK2xQ/19ji3uDPM7uT4692LbwWF1TiaA9vUuebMGazoW/98br
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
119
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOPUWytsUP9fY4t7gzzO7k+Ovdi28FhdU4mgPb1LnmzBms6Fv/fG6zfcWbtC9QFsLRI7N5JiQ0we3iRBl541AHE= uabhnil@elxadlj3q32

lib/ssh/test/property_test/ssh_eqc_client_server_dirs/id_ecdsa384

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# %CopyrightBegin%
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# %CopyrightEnd%
119
-----BEGIN EC PRIVATE KEY-----
220
MIGkAgEBBDCYXb6OSAZyXRfLXOtMo43za197Hdc/T0YKjgQQjwDt6rlRwqTh7v7S
321
PV2kXwNGdWigBwYFK4EEACKhZANiAARN2khlJUOOIiwsWHEALwDieeZR96qL4pUd

0 commit comments

Comments
 (0)