Skip to content

Commit

Permalink
New upstream version 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Guy Hughes committed Dec 16, 2015
1 parent 5db04ab commit 5c69d6d
Show file tree
Hide file tree
Showing 53 changed files with 2,476 additions and 313 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Contributions are welcome! Please open a pull request at github:

https://github.com/lastpass/lastpass-cli

The project is licensed under the GPL version 2 (see COPYING) and
requires acceptance of the Developer's Certificate of Origin for
The project is licensed under the GPL version 2 or later with an
exception for linking with OpenSSL (see COPYING and LICENSE.OpenSSL),
and requires acceptance of the Developer's Certificate of Origin for
contributions (see below).

To indicate your acceptance of Developer's Certificate of Origin 1.1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ install-doc: doc-man
@install -v -d "$(DESTDIR)$(MANDIR)/man1" && install -m 0644 -v lpass.1 "$(DESTDIR)$(MANDIR)/man1/lpass.1"

install: all
@install -v -d "$(DESTDIR)$(BINDIR)" && install -s -m 0755 -v lpass "$(DESTDIR)$(BINDIR)/lpass"
@install -v -d "$(DESTDIR)$(BINDIR)" && install -m 0755 -v lpass "$(DESTDIR)$(BINDIR)/lpass"

uninstall:
@rm -vrf "$(DESTDIR)$(MANDIR)/man1/lpass.1" "$(DESTDIR)$(BINDIR)/lpass"
Expand Down
57 changes: 48 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Command line interface to [LastPass.com](https://lastpass.com/).

### Installing on Linux
#### Arch
* Binary packages are available in the Arch User Repository [AUR](https://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=lastpass-cli).
* Binary packages are available in the [Arch User Repository (AUR)](https://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=lastpass-cli). Information about installing packages from the AUR [can be found on the Arch wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages).


#### Redhat/Centos
Expand Down Expand Up @@ -47,40 +47,79 @@ sudo apt-get install openssl libcurl4-openssl-dev libxml2 libssl-dev libxml2-dev
```

#### Gentoo
* Install the package
* Install the package:

```
sudo emerge lastpass-cli
```

#### Other Linux Distros
Install the packages listed in the Dependencies section of this document.
Install the packages listed in the Dependencies section of this document,
and then follow instructions in the 'Building' section.

### Installing on OS X
* Install homebrew following the instructions at http://brew.sh/
* Install lastpass-cli using homebrew:

#### With [Homebrew](http://brew.sh/) (easiest)
* Install Homebrew, if necessary.
* Update Homebrew's local formula cache:

```
brew update
```

* Install the lastpass-cli formula:

```
brew install lastpass-cli --with-pinentry
```

Optionally you can add `--with-doc` to install the documentation.
Alternatively, if you want to install the documentation as well:

```
brew install lastpass-cli --with-pinentry --with-doc
```

#### With [MacPorts](https://www.macports.org/)
* [Install MacPorts](https://www.macports.org/install.php), if necessary.
* Update MacPorts' local ports tree:

```
sudo port selfupdate
```

* Install the lastpass-cli port:

```
sudo port install lastpass-cli
```

* Optionally install the documentation:

```
sudo port install lastpass-cli-doc
```

#### Manually
Install the packages listed in the Dependencies section of this document,
and then follow instructions in the 'Building' section.

### Installing on FreeBSD
* Install the binary package
* Install the binary package:

```
sudo pkg install security/lastpass-cli
```

* Or build the port yourself
* Or build the port yourself:

```
sudo make -C /usr/ports/security/lastpass-cli all install clean
```

### Installing on Cygwin
* Install [apt-cyg](https://github.com/transcode-open/apt-cyg)
* Using apt-cyg, install the needed dependencies
* Using apt-cyg, install the needed build dependencies, and then follow
instructions in the 'Building' section.

```
apt-cyg install wget make gcc-core openssl-devel libcurl-devel libxml2-devel cygutils-extra
Expand Down
43 changes: 35 additions & 8 deletions agent.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
/*
* Copyright (c) 2014 LastPass.
* agent for caching decryption key
*
* Copyright (C) 2014-2015 LastPass.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
*
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*
* See LICENSE.OpenSSL for more details regarding this exception.
*/

#include "agent.h"
Expand Down Expand Up @@ -103,7 +133,6 @@ static int agent_socket_get_cred(int fd, struct ucred *cred)

static void agent_run(unsigned const char key[KDF_HASH_LEN])
{
_cleanup_free_ char *path;
char *agent_timeout_str;
unsigned int agent_timeout;
struct sockaddr_un sa, listensa;
Expand All @@ -123,7 +152,7 @@ static void agent_run(unsigned const char key[KDF_HASH_LEN])
if (agent_timeout)
alarm(agent_timeout);

path = agent_socket_path();
_cleanup_free_ char *path = agent_socket_path();
if (strlen(path) >= sizeof(sa.sun_path))
die("Path too large for agent control socket.");

Expand Down Expand Up @@ -170,12 +199,11 @@ static void agent_run(unsigned const char key[KDF_HASH_LEN])

void agent_kill(void)
{
_cleanup_free_ char *path;
struct sockaddr_un sa;
struct ucred cred;
int fd;

path = agent_socket_path();
_cleanup_free_ char *path = agent_socket_path();
if (strlen(path) >= sizeof(sa.sun_path))
die("Path too large for agent control socket.");

Expand Down Expand Up @@ -205,12 +233,11 @@ void agent_kill(void)

static bool agent_ask(unsigned char key[KDF_HASH_LEN])
{
_cleanup_free_ char *path;
struct sockaddr_un sa;
int fd;
bool ret = false;

path = agent_socket_path();
_cleanup_free_ char *path = agent_socket_path();
if (strlen(path) >= sizeof(sa.sun_path))
die("Path too large for agent control socket.");

Expand Down Expand Up @@ -279,7 +306,7 @@ bool agent_get_decryption_key(unsigned char key[KDF_HASH_LEN])
char *disable_str;

if (config_exists("plaintext_key")) {
_cleanup_free_ char *key_buffer = NULL;
_cleanup_free_ unsigned char *key_buffer = NULL;
if (config_read_buffer("plaintext_key", &key_buffer) == KDF_HASH_LEN) {
_cleanup_free_ char *verify = config_read_encrypted_string("verify", (unsigned char *)key_buffer);
if (!verify || strcmp(verify, AGENT_VERIFICATION_STRING))
Expand Down
Loading

0 comments on commit 5c69d6d

Please sign in to comment.