File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
contracts/passport/authenticators Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ contract PRSASHAAuthenticator is Initializable {
24
24
* @notice Checks active authentication of a passport. The RSA algorithm is as follows:
25
25
*
26
26
* 1. Decrypt the signature
27
- * 2. Remove the 1 byte (hash function indicator) suffix
27
+ * 2. Remove the 1 byte or 2 bytes (hash function indicator) suffix
28
28
* 3. The last 20 bytes of the decrypted signature is the SHA1 hash of random + challenge or the last 32 bytes in case SHA2 hash
29
29
*/
30
30
function authenticate (
@@ -41,7 +41,8 @@ contract PRSASHAAuthenticator is Initializable {
41
41
bytes memory decipher_ = s_.decrypt (e_, n_);
42
42
43
43
assembly {
44
- mstore (decipher_, sub (mload (decipher_), 1 ))
44
+ let suffixLen_ := add (1 , iszero (sload (isSha1.slot)))
45
+ mstore (decipher_, sub (mload (decipher_), suffixLen_))
45
46
}
46
47
47
48
bytes memory prepared_ = new bytes (decipher_.length - hashLen - 1 );
Original file line number Diff line number Diff line change @@ -101,7 +101,15 @@ const config: HardhatUserConfig = {
101
101
chainId : 7368 ,
102
102
urls : {
103
103
apiURL : "https://evmscan.l2.rarimo.com/api" ,
104
- browserURL : "https://newscan.l2.rarimo.com/" ,
104
+ browserURL : "https://scan.rarimo.com/" ,
105
+ } ,
106
+ } ,
107
+ {
108
+ network : "rarimo-l2-testnet" ,
109
+ chainId : 7369 ,
110
+ urls : {
111
+ apiURL : "https://scan.testnet.rarimo.com/api" ,
112
+ browserURL : "https://scan.testnet.rarimo.com" ,
105
113
} ,
106
114
} ,
107
115
{
You can’t perform that action at this time.
0 commit comments