File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ const BaseKey = {
446446 this . type === parsed . type
447447 && this [ SYM_PRIV_PEM ] === parsed [ SYM_PRIV_PEM ]
448448 && this [ SYM_PUB_PEM ] === parsed [ SYM_PUB_PEM ]
449- && this [ SYM_PUB_SSH ] === parsed [ SYM_PUB_SSH ]
449+ && this [ SYM_PUB_SSH ] . equals ( parsed [ SYM_PUB_SSH ] )
450450 ) ;
451451 } ,
452452} ;
Original file line number Diff line number Diff line change @@ -82,6 +82,22 @@ readdirSync(BASE_PATH).forEach((name) => {
8282 + `Received: ${ inspect ( details ) } ` )
8383 ) ;
8484 } ) ;
85+
86+ // Test `equals()`
87+ let copy ;
88+ if ( isEncrypted )
89+ copy = parseKey ( key , ( isPPK ? 'node.js' : 'password' ) ) ;
90+ else
91+ copy = parseKey ( key ) ;
92+ if ( ! Array . isArray ( copy ) )
93+ copy = [ copy ] ;
94+ for ( let i = 0 ; i < res . length ; ++ i ) {
95+ assert . strictEqual (
96+ res [ i ] . equals ( copy [ i ] ) ,
97+ true ,
98+ failMsg ( name , 'equals() failed with copy' )
99+ ) ;
100+ }
85101 }
86102
87103 if ( isEncrypted && ! isPublic ) {
You can’t perform that action at this time.
0 commit comments