File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,12 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
512512 // input tkey device share when required share > 0 ( or not reconstructed )
513513 // assumption tkey shares will not changed
514514 if ( ! this . tKey . secp256k1Key ) {
515+ const factorKeyPrivate = factorKeyCurve . keyFromPrivate ( factorKey . toBuffer ( ) ) ;
516+ const factorPubX = factorKeyPrivate . getPublic ( ) . getX ( ) . toString ( "hex" ) . padStart ( 64 , "0" ) ;
517+ const factorEncExist = this . tkey . metadata . factorEncs ?. [ this . tkey . tssTag ] ?. [ factorPubX ] ;
518+ if ( ! factorEncExist ) {
519+ throw CoreKitError . providedFactorKeyInvalid ( "Invalid FactorKey provided. Failed to input factor key." ) ;
520+ }
515521 const factorKeyMetadata = await this . getFactorKeyMetadata ( factorKey ) ;
516522 await this . tKey . inputShareStoreSafe ( factorKeyMetadata , true ) ;
517523 }
You can’t perform that action at this time.
0 commit comments