aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/account_manager.go
Commit message (Collapse)AuthorAgeFilesLines
* accounts, cmd, eth, internal, mobile, node: split account backendsPéter Szilágyi2017-02-131-350/+0
|
* accounts, mobile: make account manager API a bit more uniformPéter Szilágyi2017-01-171-3/+3
|
* accounts, internal, mobile: polish accounts API, extend Android testsPéter Szilágyi2017-01-051-2/+2
|
* accounts, core, crypto, internal: use normalised V during signature handling ↵Péter Szilágyi2017-01-051-20/+7
| | | | | | | | | (#3455) To address increasing complexity in code that handles signatures, this PR discards all notion of "different" signature types at the library level. Both the crypto and accounts package is reduced to only be able to produce plain canonical secp256k1 signatures. This makes the crpyto APIs much cleaner, simpler and harder to abuse.
* accounts: add Find methodFelix Lange2016-11-111-1/+7
|
* internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)bas-vk2016-10-291-5/+20
| | | | | | | | | | | | | | | | | | | | This commit includes several API changes: - The behavior of eth_sign is changed. It now accepts an arbitrary message, prepends the well-known string \x19Ethereum Signed Message:\n<length of message> hashes the result using keccak256 and calculates the signature of the hash. This breaks backwards compatability! - personal_sign(hash, address [, password]) is added. It has the same semantics as eth_sign but also accepts a password. The private key used to sign the hash is temporarily unlocked in the scope of the request. - personal_recover(message, signature) is added and returns the address for the account that created a signature.
* cmd/utils, node: create account manager in package nodeFelix Lange2016-08-171-22/+0
| | | | | | | | | | | | | | | The account manager was previously created by packge cmd/utils as part of flag processing and then passed down into eth.Ethereum through its config struct. Since we are starting to create nodes which do not have eth.Ethereum as a registered service, the code was rearranged to register the account manager as its own service. Making it a service is ugly though and it doesn't really fix the root cause: creating nodes without eth.Ethereum requires duplicating lots of code. This commit splits utils.MakeSystemNode into three functions, making creation of other node/service configurations easier. It also moves the account manager into Node so it can be used by those configurations without requiring package eth.
* eth: separate common and full node-specific API and backend servicezsfelfoldi2016-06-161-0/+22
|
* eth: add new RPC method (personal.) SignAndSendTransactionBas van Kervel2016-05-201-2/+14
|
* eth: add personal_importRawKey for runtime private key importAles Katona2016-04-281-1/+6
|
* accounts: ensure TimedUnlock does not override indefinite unlock timeoutFelix Lange2016-04-121-8/+14
|
* accounts: improve API and add documentationFelix Lange2016-04-121-35/+71
| | | | | - Sign takes common.Address, not Account - Import/Export methods work with encrypted JSON keys
* accounts: add ErrDecryptFelix Lange2016-04-121-0/+1
|
* accounts: cache key addressesFelix Lange2016-04-121-78/+111
| | | | | | | | | | | | | | | In order to avoid disk thrashing for Accounts and HasAccount, address->key file mappings are now cached in memory. This makes it no longer necessary to keep the key address in the file name. The address of each key is derived from file content instead. There are minor user-visible changes: - "geth account list" now reports key file paths alongside the address. - If multiple keys are present for an address, unlocking by address is not possible. Users are directed to remove the duplicate files instead. Unlocking by index is still possible. - Key files are overwritten written in place when updating the password.
* accounts: streamline APIFelix Lange2016-04-121-33/+24
| | | | | | - Manager.Accounts no longer returns an error. - Manager methods take Account instead of common.Address. - All uses of Account with unkeyed fields are converted.
* accounts, crypto: move keystore to package accountsFelix Lange2016-04-121-13/+21
| | | | | | | | | | The account management API was originally implemented as a thin layer around crypto.KeyStore, on the grounds that several kinds of key stores would be implemented later on. It turns out that this won't happen so KeyStore is a superflous abstraction. In this commit crypto.KeyStore and everything related to it moves to package accounts and is unexported.
* rpc: migrated the RPC insterface to a new reflection based RPC layerBas van Kervel2016-01-261-1/+1
|
* rpc: new RPC implementation with pub/sub supportBas van Kervel2015-12-141-0/+15
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* accounts: fix data race when key is locked after the unlock timeoutFelix Lange2015-07-211-5/+8
| | | | | | While here, also improve the docs and speed up the tests. The tests used the scrypt keystore with ridiculous settins and took 20s each.
* fix wallet key duplicate write - how did it get there? mystery. fixes #1411zelig2015-07-091-3/+0
|
* all: add some godoc synopsis commentsFelix Lange2015-07-071-10/+6
|
* all: remove @author commentsFelix Lange2015-07-071-6/+0
|
* all: update license informationFelix Lange2015-07-071-15/+15
|
* account update: migrate or change passwordzelig2015-07-031-0/+28
| | | | | | * account.Update * KeyStore.Cleanup * fix dir rm for old format deleteKey
* fix account orderingzelig2015-07-031-3/+3
| | | | | | | | * chronological order of creation * new naming scheme keystore/UTC--<created_at UTC ISO8601>-<address hex> * KeyStore2 -> KeyStore * backward compatibility * refactor keyStore methods
* unlock multiple passes and obsolete primaryzelig2015-07-031-13/+0
| | | | | | | * multiple passwords allowed in password file * split on "\n", sideeffect: chop trailing slashes. fixes common mistake <(echo 'pass') * remove accounts.Primary method * do not fall back to primary account for mining
* simplify account unlockingzelig2015-07-031-55/+43
|
* Introduced default unlock duration when an account is unlocked from the consoleBas van Kervel2015-05-141-0/+5
|
* Use common.Address type for accounts.AddressGustav Simonsson2015-05-121-21/+21
|
* settable etherbasezelig2015-03-271-7/+1
| | | | | | | | - etherbase flag for block reward destination - coinbase => etherbase - CLI- eth Config -> eth, xeth -> RPC / Miner - use primary instead of coinbase as the unlock magic wildcard - accounts: firstAddr/Coinbase -> Primary
* max paranoia mode to UNsupport unencrypted keys entirelyzelig2015-03-271-0/+2
| | | | | | | - remove account export functionality from CLI - remove accountExport method, - remove unencrypted-keys flag from everywhere - improve documentation
* unlocking coinbase without knowing addresszelig2015-03-271-15/+3
| | | | | - accounts: remove Manager.getKey - cli: for -unlock coinbase, use account manager Coinbase()
* cli: implement ethereum presale wallet import via clizelig2015-03-271-0/+12
|
* unlocking coinbasezelig2015-03-271-2/+13
| | | | | - extract accounts.getKey method - if given empty address it retrieves coinbase (first account) - cli -unlock coinbase will unlock coinbase
* import/export accountszelig2015-03-271-0/+20
| | | | | | | | | | | - cli: add passwordfile flag - cli: change unlock flag only takes account - cli: with unlock you are prompted for password or use passfile with password flag - cli: unlockAccount used in normal client start (run) and accountExport - cli: getPassword used in accountCreate and accountImport - accounts: Manager.Import, Manager.Export - crypto: SaveECDSA (to complement LoadECDSA) to save to file - crypto: NewKeyFromECDSA added (used in accountImport and New = generated constructor)
* accounts: return ErrNoKeys if key directory does not existFelix Lange2015-03-101-2/+7
|
* accounts: add {Timed,}Unlock, remove SignLockedFelix Lange2015-03-101-17/+31
|
* accounts: add Manager.HasAccount, delete Manager.DefaultFelix Lange2015-03-101-9/+11
|
* accounts: don't store address in unlocked and add commentaryFelix Lange2015-03-081-8/+10
| | | | This was suggested during review.
* accounts: AccountManager -> ManagerFelix Lange2015-03-081-13/+13
|
* accounts: prevent early drops and zero keys in memory when droppingFelix Lange2015-03-081-19/+50
| | | | | Private keys would be locked early if SignLocked was called more than once because the unlockLater was still running. Terminate it properly.
* accounts: fix uses of sync.RWMutexFelix Lange2015-03-081-4/+6
| | | | | RWMutexes must be write-locked when writing in order to actually protect the writes.
* accounts: use time.Duration correctlyFelix Lange2015-03-081-9/+10
| | | | | | | There is no point to using time.Duration if the value is interpreted as milliseconds. Callers should use the standard multiplication idiom to choose the unit. In fact, the only caller outside of the tests already does so.
* accounts: use pointers consistentlyFelix Lange2015-03-081-15/+11
| | | | | | | | Account is now always a non-pointer. This will be important once the manager starts remembering accounts. AccountManager is now always a pointer because it contains locks and locks cannot be copied.
* accounts, core, eth, xeth: use account manager for everythingFelix Lange2015-03-071-7/+32
| | | | | The account manager is now responsible for picking the default account and the coinbase.
* Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into developobscuren2015-02-261-9/+41
|\ | | | | | | | | Conflicts: accounts/account_manager.go
| * Remove unneeded initialisation of mutexGustav Simonsson2015-02-261-1/+0
| |
| * Address pull request commentsGustav Simonsson2015-02-261-16/+18
| | | | | | | | | | | | * Use RWMutex instead of Mutex * Use time.Duration instead of int for unlock time * Use time.After with select instead of time.Sleep
| * Add automatic locking / unlocking of accountsGustav Simonsson2015-02-261-9/+39
| | | | | | | | | | | | | | * Change account signing API to two sign functions; Sign without passphrase - works if account is unlocked Sign with passphrase - always works and unlocks the account * Account stays unlocked for X ms and is then automatically locked
* | wipobscuren2015-02-261-0/+1
|/
* Fix key store address hex decoding and accounts testGustav Simonsson2015-02-251-0/+4
| | | | Thanks to https://github.com/jaekwon for original fix!
* Address pull request commentsGustav Simonsson2015-01-281-16/+12
| | | | | | | | | * Use crypto.Sign instead of directly calling secp256k1 lib * Rename UserAccount to Account and Addr to Address (for consistency) * Change AccountManager.Sign to take ptr to Account instead of address byte array * Simplify copying of Accounts in Accounts() * PubkeyToAddress and GetEntropyCSPRNG now exported
* Add accounts package and refactor key storesGustav Simonsson2015-01-261-0/+99
* Add initial UserAccount and AccountManager structs * Add NewAccount, Sign and Accounts functions * Refactor key stores to use key address as main identifier while keeping the UUID. * Use key address as file/dir names instead of UUID