File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -116,4 +116,48 @@ public function testSha1Fingerprint()
116116 $ connection2 ->fingerprint (SSHConnection::FINGERPRINT_SHA1 )
117117 );
118118 }
119+
120+ public function testMd5FingerprintFailure ()
121+ {
122+ $ connection1 = (new SSHConnection ())
123+ ->to ('localhost ' )
124+ ->onPort (22 )
125+ ->as ('travis ' )
126+ ->withPrivateKey ('/home/travis/.ssh/id_rsa ' )
127+ ->connect ();
128+
129+ $ connection2 = (new SSHConnection ())
130+ ->to ('test.rebex.net ' )
131+ ->onPort (22 )
132+ ->as ('demo ' )
133+ ->withPassword ('password ' )
134+ ->connect ();
135+
136+ $ this ->assertNotEquals (
137+ $ connection1 ->fingerprint (SSHConnection::FINGERPRINT_MD5 ),
138+ $ connection2 ->fingerprint (SSHConnection::FINGERPRINT_MD5 )
139+ );
140+ }
141+
142+ public function testSha1FingerprintFailure ()
143+ {
144+ $ connection1 = (new SSHConnection ())
145+ ->to ('localhost ' )
146+ ->onPort (22 )
147+ ->as ('travis ' )
148+ ->withPrivateKey ('/home/travis/.ssh/id_rsa ' )
149+ ->connect ();
150+
151+ $ connection2 = (new SSHConnection ())
152+ ->to ('test.rebex.net ' )
153+ ->onPort (22 )
154+ ->as ('demo ' )
155+ ->withPassword ('password ' )
156+ ->connect ();
157+
158+ $ this ->assertNotEquals (
159+ $ connection1 ->fingerprint (SSHConnection::FINGERPRINT_SHA1 ),
160+ $ connection2 ->fingerprint (SSHConnection::FINGERPRINT_SHA1 )
161+ );
162+ }
119163}
You can’t perform that action at this time.
0 commit comments