Initial Intel TEE integration.
This commit is contained in:
parent
62cc46e455
commit
0c69dfb061
24 changed files with 492 additions and 75 deletions
|
|
@ -5,6 +5,12 @@ angular.module('copayApp.services')
|
|||
var root = {};
|
||||
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
||||
|
||||
root.description = {
|
||||
id: 'ledger',
|
||||
name: 'Ledger',
|
||||
longName: 'Ledger Hardware Wallet'
|
||||
};
|
||||
|
||||
root.callbacks = {};
|
||||
root.hasSession = function() {
|
||||
root._message({
|
||||
|
|
@ -13,7 +19,7 @@ angular.module('copayApp.services')
|
|||
}
|
||||
|
||||
root.getEntropySource = function(isMultisig, account, callback) {
|
||||
root.getXPubKey(hwWallet.getEntropyPath('ledger', isMultisig, account), function(data) {
|
||||
root.getXPubKey(hwWallet.getEntropyPath(root.description.id, isMultisig, account), function(data) {
|
||||
if (!data.success)
|
||||
return callback(hwWallet._err(data));
|
||||
|
||||
|
|
@ -30,21 +36,27 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.getInfoForNewWallet = function(isMultisig, account, callback) {
|
||||
root.getEntropySource(isMultisig, account, function(err, entropySource) {
|
||||
root.initSource = function(opts, callback) {
|
||||
// No initialization for this hardware source.
|
||||
return callback(opts);
|
||||
};
|
||||
|
||||
root.getInfoForNewWallet = function(opts, callback) {
|
||||
var isMultisig = opts.n > 1;
|
||||
root.getEntropySource(isMultisig, opts.account, function(err, entropySource) {
|
||||
if (err) return callback(err);
|
||||
|
||||
root.getXPubKey(hwWallet.getAddressPath('ledger', isMultisig, account), function(data) {
|
||||
if (!data.success) return callback(data);
|
||||
|
||||
var opts = {};
|
||||
opts.entropySource = entropySource;
|
||||
opts.entropySource = entropySource;
|
||||
root.getXPubKey(hwWallet.getAddressPath(root.description.id, isMultisig, opts.account), function(data) {
|
||||
if (!data.success) {
|
||||
$log.warn(data.message);
|
||||
return callback(data);
|
||||
}
|
||||
opts.extendedPublicKey = data.xpubkey;
|
||||
opts.externalSource = 'ledger';
|
||||
opts.account = account;
|
||||
opts.externalSource = root.description.id;
|
||||
|
||||
// Old ledger compat
|
||||
opts.derivationStrategy = account ? 'BIP48' : 'BIP44';
|
||||
opts.derivationStrategy = opts.account ? 'BIP48' : 'BIP44';
|
||||
return callback(null, opts);
|
||||
});
|
||||
});
|
||||
|
|
@ -57,7 +69,7 @@ angular.module('copayApp.services')
|
|||
var tx = bwcService.getUtils().buildTx(txp);
|
||||
for (var i = 0; i < tx.inputs.length; i++) {
|
||||
redeemScripts.push(new ByteString(tx.inputs[i].redeemScript.toBuffer().toString('hex'), GP.HEX).toString());
|
||||
paths.push(hwWallet.getAddressPath('ledger', isMultisig, account) + txp.inputs[i].path.substring(1));
|
||||
paths.push(hwWallet.getAddressPath(root.description.id, isMultisig, account) + txp.inputs[i].path.substring(1));
|
||||
}
|
||||
var splitTransaction = root._splitTransaction(new ByteString(tx.toString(), GP.HEX));
|
||||
var inputs = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue