@@ -20,14 +20,14 @@ import (
2020func TestAuthenticateObject (t * testing.T ) {
2121 t .Run ("without signature" , func (t * testing.T ) {
2222 obj := getUnsignedObject ()
23- require .EqualError (t , icrypto .AuthenticateObject (obj , nil ), "missing signature" )
23+ require .EqualError (t , icrypto .AuthenticateObject (obj , nil , false ), "missing signature" )
2424 })
2525 t .Run ("unsupported scheme" , func (t * testing.T ) {
2626 obj := objectECDSASHA512
2727 sig := * obj .Signature ()
2828 sig .SetScheme (4 )
2929 obj .SetSignature (& sig )
30- require .EqualError (t , icrypto .AuthenticateObject (obj , nil ), "unsupported scheme 4" )
30+ require .EqualError (t , icrypto .AuthenticateObject (obj , nil , false ), "unsupported scheme 4" )
3131 })
3232 t .Run ("invalid public key" , func (t * testing.T ) {
3333 for _ , tc := range []struct {
@@ -48,7 +48,7 @@ func TestAuthenticateObject(t *testing.T) {
4848 sig := * obj .Signature ()
4949 sig .SetPublicKeyBytes (tc .changePub (sig .PublicKeyBytes ()))
5050 obj .SetSignature (& sig )
51- err := icrypto .AuthenticateObject (obj , nil )
51+ err := icrypto .AuthenticateObject (obj , nil , false )
5252 require .EqualError (t , err , "scheme ECDSA_SHA512: decode public key: " + tc .err )
5353 })
5454 }
@@ -70,7 +70,7 @@ func TestAuthenticateObject(t *testing.T) {
7070 cp [i ]++
7171 sig .SetValue (cp )
7272 tc .obj .SetSignature (& sig )
73- err := icrypto .AuthenticateObject (tc .obj , nil )
73+ err := icrypto .AuthenticateObject (tc .obj , nil , false )
7474 require .EqualError (t , err , fmt .Sprintf ("scheme %s: signature mismatch" , tc .scheme ))
7575 }
7676 })
@@ -86,7 +86,7 @@ func TestAuthenticateObject(t *testing.T) {
8686 {scheme : neofscrypto .ECDSA_WALLETCONNECT , object : wrongOwnerObjectECDSAWalletConnect },
8787 } {
8888 t .Run (tc .scheme .String (), func (t * testing.T ) {
89- require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil ), "owner mismatches signature" )
89+ require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil , false ), "owner mismatches signature" )
9090 })
9191 }
9292 })
@@ -101,7 +101,7 @@ func TestAuthenticateObject(t *testing.T) {
101101 {scheme : neofscrypto .ECDSA_WALLETCONNECT , object : objectWithNoIssuerSessionECDSAWalletConnect },
102102 } {
103103 t .Run (tc .scheme .String (), func (t * testing.T ) {
104- require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil ), "session token: missing issuer" )
104+ require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil , false ), "session token: missing issuer" )
105105 })
106106 }
107107 })
@@ -115,7 +115,7 @@ func TestAuthenticateObject(t *testing.T) {
115115 {scheme : neofscrypto .ECDSA_WALLETCONNECT , object : objectWithWrongIssuerSessionECDSAWalletConnect },
116116 } {
117117 t .Run (tc .scheme .String (), func (t * testing.T ) {
118- require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil ), "session token: issuer mismatches signature" )
118+ require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil , false ), "session token: issuer mismatches signature" )
119119 })
120120 }
121121 })
@@ -129,7 +129,7 @@ func TestAuthenticateObject(t *testing.T) {
129129 {scheme : neofscrypto .ECDSA_WALLETCONNECT , object : objectWithWrongSessionSubjectECDSAWalletConnect },
130130 } {
131131 t .Run (tc .scheme .String (), func (t * testing.T ) {
132- require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil ), "session token is not for object's signer" )
132+ require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil , false ), "session token is not for object's signer" )
133133 })
134134 }
135135 })
@@ -143,7 +143,7 @@ func TestAuthenticateObject(t *testing.T) {
143143 {scheme : neofscrypto .ECDSA_WALLETCONNECT , object : objectWithWrongOwnerSessionECDSAWalletConnect },
144144 } {
145145 t .Run (tc .scheme .String (), func (t * testing.T ) {
146- require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil ), "different object owner and session issuer" )
146+ require .EqualError (t , icrypto .AuthenticateObject (tc .object , nil , false ), "different object owner and session issuer" )
147147 })
148148 }
149149 })
@@ -160,7 +160,7 @@ func TestAuthenticateObject(t *testing.T) {
160160 {name : neofscrypto .ECDSA_WALLETCONNECT .String () + " with session" , object : objectWithSessionECDSAWalletConnect },
161161 } {
162162 t .Run (tc .name , func (t * testing.T ) {
163- require .NoError (t , icrypto .AuthenticateObject (tc .object , nil ))
163+ require .NoError (t , icrypto .AuthenticateObject (tc .object , nil , false ))
164164 })
165165 }
166166}
0 commit comments