File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed
lib/cloud_controller/diego
spec/unit/lib/cloud_controller/diego Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ def app_lrp_arguments
6060 routes [ SSH_ROUTES_KEY ] = Oj . dump ( {
6161 container_port : DEFAULT_SSH_PORT ,
6262 private_key : ssh_key . private_key ,
63- host_fingerprint : ssh_key . fingerprint
63+ host_fingerprint : ssh_key . fingerprint ,
64+ host_256_fingerprint : ssh_key . sha256_fingerprint
6465 } )
6566 end
6667
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ def fingerprint
2626 @fingerprint ||= ::SSHKey . new ( key . to_der ) . sha1_fingerprint
2727 end
2828
29+ def sha256_fingerprint
30+ @sha256_fingerprint ||= ::SSHKey . new ( key . to_der ) . sha256_fingerprint
31+ end
32+
2933 private
3034
3135 def key
Original file line number Diff line number Diff line change @@ -901,7 +901,8 @@ module Diego
901901 expect ( lrp . routes . routes [ 'diego-ssh' ] ) . to eq ( Oj . dump ( {
902902 container_port : 2222 ,
903903 private_key : ssh_key . private_key ,
904- host_fingerprint : ssh_key . fingerprint
904+ host_fingerprint : ssh_key . fingerprint ,
905+ host_256_fingerprint : ssh_key . sha256_fingerprint
905906 } ) )
906907 end
907908 end
@@ -1001,7 +1002,8 @@ module Diego
10011002 expect ( lrp . routes . routes [ 'diego-ssh' ] ) . to eq ( Oj . dump ( {
10021003 container_port : 2222 ,
10031004 private_key : ssh_key . private_key ,
1004- host_fingerprint : ssh_key . fingerprint
1005+ host_fingerprint : ssh_key . fingerprint ,
1006+ host_256_fingerprint : ssh_key . sha256_fingerprint
10051007 } ) )
10061008 end
10071009 end
@@ -1344,7 +1346,8 @@ module Diego
13441346 expect ( lrp . routes . routes [ 'diego-ssh' ] ) . to eq ( Oj . dump ( {
13451347 container_port : 2222 ,
13461348 private_key : ssh_key . private_key ,
1347- host_fingerprint : ssh_key . fingerprint
1349+ host_fingerprint : ssh_key . fingerprint ,
1350+ host_256_fingerprint : ssh_key . sha256_fingerprint
13481351 } ) )
13491352 end
13501353 end
Original file line number Diff line number Diff line change @@ -39,6 +39,13 @@ module Diego
3939 expect ( ssh_key . fingerprint ) . to match ( /([0-9a-f]{2}:){19}[0-9a-f]{2}/ )
4040 end
4141 end
42+
43+ describe '#fingerprint 256' do
44+ it 'returns an sha256 fingerprint' do
45+ ssh_key = SSHKey . new ( 1024 )
46+ expect ( ssh_key . sha256_fingerprint ) . to match ( /[a-zA-Z0-9+\/ =]{44}/ )
47+ end
48+ end
4249 end
4350 end
4451end
You can’t perform that action at this time.
0 commit comments