When and where to add extra information when signing P2SH raw transaction?
Bitcoin Core's signrawtransaction RPC does not know about the specific type of script you're trying to sign for, and won't be usable.

You'll need to implement the signing logic yourself.