diff --git a/src/claims/payloads/claimNetworkAccess.ts b/src/claims/payloads/claimNetworkAccess.ts index 1a48d241d..0be8a340e 100644 --- a/src/claims/payloads/claimNetworkAccess.ts +++ b/src/claims/payloads/claimNetworkAccess.ts @@ -56,7 +56,9 @@ function assertClaimNetworkAccess( } if ( claimNetworkAccess['signedClaimNetworkAuthorityEncoded'] != null && - !tokensSchema.validateSignedTokenEncoded(claimNetworkAccess['signedClaimNetworkAuthorityEncoded']) + !tokensSchema.validateSignedTokenEncoded( + claimNetworkAccess['signedClaimNetworkAuthorityEncoded'], + ) ) { throw new validationErrors.ErrorParse( '`signedClaimNetworkAuthorityEncoded` property must be an encoded signed token', diff --git a/src/nodes/NodeManager.ts b/src/nodes/NodeManager.ts index adfaeed59..8cd47d92b 100644 --- a/src/nodes/NodeManager.ts +++ b/src/nodes/NodeManager.ts @@ -263,43 +263,6 @@ class NodeManager { cause: new AggregateError(failedConnectionErrors), }, ); - } else { - // Wip: We should ideally take the fastest connection and use it here for node signing. - const conn = successfulConnections[0].value; - await this.sigchain.addClaim( - { - typ: 'ClaimNetworkNode', - iss: nodesUtils.encodeNodeId(conn.nodeId), - sub: nodesUtils.encodeNodeId(this.keyRing.getNodeId()), - }, - undefined, - async (token) => { - const halfSignedClaim = token.toSigned(); - const halfSignedClaimEncoded = - claimsUtils.generateSignedClaim(halfSignedClaim); - const receivedClaim = - await conn.rpcClient.methods.nodesClaimNetworkSign({ - signedTokenEncoded: halfSignedClaimEncoded, - }); - const signedClaim = claimsUtils.parseSignedClaim( - receivedClaim.signedTokenEncoded, - ); - const fullySignedToken = Token.fromSigned(signedClaim); - // Check that the signatures are correct - const targetNodePublicKey = keysUtils.publicKeyFromNodeId( - conn.nodeId, - ); - if ( - !fullySignedToken.verifyWithPublicKey( - this.keyRing.keyPair.publicKey, - ) || - !fullySignedToken.verifyWithPublicKey(targetNodePublicKey) - ) { - throw new claimsErrors.ErrorDoublySignedClaimVerificationFailed(); - } - return fullySignedToken; - }, - ); } if (ctx.signal.aborted) return;