Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed security issue with passwords entered via a prompt
  • Loading branch information
paulej committed Aug 1, 2022
1 parent d44a7f4 commit 6876185
Show file tree
Hide file tree
Showing 13 changed files with 353 additions and 181 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/build
Linux/build
15 changes: 13 additions & 2 deletions Linux/CMakeLists.txt
@@ -1,5 +1,16 @@
cmake_minimum_required(VERSION 3.9)

project( aescrypt )
option(aescrypt_BUILD_TESTS "Build Tests for AESCrypt" ON)

add_subdirectory( src/ )
project(aescrypt
VERSION 3.16
DESCRIPTION "AES Crypt for Linux"
LANGUAGES C)

add_subdirectory(src)

include(CTest)

if(BUILD_TESTING AND aescrypt_BUILD_TESTS)
add_subdirectory(test)
endif()
3 changes: 3 additions & 0 deletions Linux/README
Expand Up @@ -28,6 +28,9 @@ https://www.gnu.org/licenses/gpl-2.0.txt

2. Installing

NOTE: These instructions correspond to the official release files
available from aescrypt.com.

Extract the source archive. If you are reading this, you probably
already have. Just in case you have not, extract the files using
a command like this:
Expand Down
59 changes: 42 additions & 17 deletions Linux/README.md
@@ -1,32 +1,57 @@
# AES Crypt (Linux source code)

The Linux source code in the git respository is intended for use with
"The Autotools". This includes the following packages: autoconf; automake; and, libtool.
Install these from your distro packages.
The Linux source code in the git repository is intended for use with CMake or
"The Autotools".

## CMake build

Change to the Linux directory and issue the following commands to create
a release build:

```bash
cmake -B build -S . --install-prefix=/usr -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build build --parallel
```

The aescrypt and aescrypt_keygen binaries will be placed in the directory
`build/src/` once the build completes.

If you wish to install the two binary files `aescrypt` and `aescrypt_keygen`,
just run this command:

```bash
cmake --install build
```

To invoke the tests to ensure everything is working properly, do the following:

```bash
cd build
make test
```

## Using Autotools

Install these from your Linus distribution packages:

* autoconf
* automake
* libtool

Before you can build the software, you need to run the
following command:

```
autoreconf -ivf
```bash
autoreconf -ivf
```

Note that the package maintainers, when producing an official release,
will run the above command and only publish the source files needed
to run "configure" and "make". Official source releases can be downloaded
from https://www.aescrypt.com/.
from [aescrypt.com](https://www.aescrypt.com/download/).

Package maintainers can create a tarball using the following command:

```bash
make dist
```
make dist
```

## CMake build

mkdir build
cd build
cmake ../
make


41 changes: 25 additions & 16 deletions Linux/src/CMakeLists.txt
@@ -1,25 +1,34 @@
cmake_minimum_required(VERSION 3.9)

string(TIMESTAMP PACKAGE_DATE %Y-%m-%dT%H:%M:%SZ UTC)
add_definitions( -DPACKAGE_NAME="aescrypt" )
add_definitions( -DPACKAGE_VERSION="1.0.0" )
add_definitions( -DPACKAGE_DATE="${PACKAGE_DATE}" )

set( HEADER_FILES
password.h
aes.h
aesrandom.h
sha256.h
util.h
keyfile.h )
# Build a version number into the binary library
configure_file(version.h.in version.h @ONLY)

set( COMMON_SOURCE_FILES
add_executable(aescrypt
aescrypt.c
aes.c
aesrandom.c
sha256.c
util.c
keyfile.c
password.c )
password.c)
target_compile_definitions(aescrypt PRIVATE ENABLE_ICONV)

target_include_directories(aescrypt
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

add_executable(aescrypt_keygen
aescrypt_keygen.c
aes.c
aesrandom.c
sha256.c
util.c
keyfile.c
password.c)

target_include_directories(aescrypt_keygen
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

add_executable( aescrypt aescrypt.c ${COMMON_SOURCE_FILES} )
add_executable( aescrypt_keygen aescrypt_keygen.c ${COMMON_SOURCE_FILES} )
# Install target and associated include files
install(TARGETS aescrypt aescrypt_keygen)

0 comments on commit 6876185

Please sign in to comment.