mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
added context to pcp_readpass(), rm libpcp/getpass.c
This commit is contained in:
@@ -4,6 +4,13 @@ NEXT
|
|||||||
have in place (-x and -X). Also, I don't generate
|
have in place (-x and -X). Also, I don't generate
|
||||||
an extra hash for the key anymore.
|
an extra hash for the key anymore.
|
||||||
|
|
||||||
|
Removed libpcp/getpass.c, not used anymore.
|
||||||
|
|
||||||
|
Added --extpass (implementation from encfs, but
|
||||||
|
somewhat modified).
|
||||||
|
|
||||||
|
Moved src/readpass.c to libpcp/.
|
||||||
|
|
||||||
0.3.0
|
0.3.0
|
||||||
Changed publuc key signature storage, previously
|
Changed publuc key signature storage, previously
|
||||||
I didn't add the actual signature, therefore a
|
I didn't add the actual signature, therefore a
|
||||||
|
|||||||
22
TODO
22
TODO
@@ -19,25 +19,3 @@ Check is_utf8 license.
|
|||||||
|
|
||||||
c++ destructor double free mess
|
c++ destructor double free mess
|
||||||
|
|
||||||
Idea from encfs:
|
|
||||||
--extpass=program
|
|
||||||
Specify an external program to use for getting the user password. When the external program
|
|
||||||
is spawned, the environment variable "RootDir" will be set to contain the path to the root
|
|
||||||
directory. The program should print the password to standard output.
|
|
||||||
|
|
||||||
EncFS takes everything returned from the program to be the password, except for a trailing
|
|
||||||
newline (\n) which will be removed.
|
|
||||||
|
|
||||||
For example, specifying --extpass=/usr/lib/ssh/ssh-askpass will cause EncFS to use ssh's
|
|
||||||
password prompt program.
|
|
||||||
|
|
||||||
Note: EncFS reads at most 2k of data from the password program, and it removes any trailing
|
|
||||||
newline. Versions before 1.4.x accepted only 64 bytes of text.
|
|
||||||
|
|
||||||
-S, --stdinpass
|
|
||||||
Read password from standard input, without prompting. This may be useful for scripting encfs
|
|
||||||
mounts.
|
|
||||||
|
|
||||||
Note that you should make sure the filesystem and mount points exist first. Otherwise encfs
|
|
||||||
will prompt for the filesystem creation options, which may interfere with your script.
|
|
||||||
|
|
||||||
|
|||||||
@@ -452,18 +452,6 @@ size_t pcp_ed_detachsign_buffered(Pcpstream *in, Pcpstream *out, pcp_key_t *s);
|
|||||||
/*** ./gencffi.pl: from ../../include/pcp/ed.h:202 */
|
/*** ./gencffi.pl: from ../../include/pcp/ed.h:202 */
|
||||||
pcp_pubkey_t *pcp_ed_detachverify_buffered(PCPCTX *ptx, Pcpstream *in, Pcpstream *sigfd, pcp_pubkey_t *p);
|
pcp_pubkey_t *pcp_ed_detachverify_buffered(PCPCTX *ptx, Pcpstream *in, Pcpstream *sigfd, pcp_pubkey_t *p);
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/getpass.h:22 */
|
|
||||||
void pcp_echo_off();
|
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/getpass.h:22 */
|
|
||||||
void pcp_echo_on();
|
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/getpass.h:22 */
|
|
||||||
char *pcp_get_stdin();
|
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/getpass.h:22 */
|
|
||||||
char *pcp_get_passphrase(char *prompt);
|
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/jenhash.h:25 */
|
/*** ./gencffi.pl: from ../../include/pcp/jenhash.h:25 */
|
||||||
unsigned jen_hash ( unsigned char *k, unsigned length, unsigned initval );
|
unsigned jen_hash ( unsigned char *k, unsigned length, unsigned initval );
|
||||||
|
|
||||||
@@ -740,6 +728,9 @@ int ps_readline(Pcpstream *stream, Buffer *line);
|
|||||||
/*** ./gencffi.pl: from ../../include/pcp/randomart.h:54 */
|
/*** ./gencffi.pl: from ../../include/pcp/randomart.h:54 */
|
||||||
char *key_fingerprint_randomart(unsigned char *dgst_raw, unsigned int dgst_raw_len);
|
char *key_fingerprint_randomart(unsigned char *dgst_raw, unsigned int dgst_raw_len);
|
||||||
|
|
||||||
|
/*** ./gencffi.pl: from ../../include/pcp/readpass.h:69 */
|
||||||
|
int pcp_readpass_fromprog(PCPCTX *ptx, char **passwd, const char *askpass);
|
||||||
|
|
||||||
/*** ./gencffi.pl: from ../../include/pcp/scrypt.h:42 */
|
/*** ./gencffi.pl: from ../../include/pcp/scrypt.h:42 */
|
||||||
byte * pcp_scrypt(PCPCTX *ptx, char *passwd, size_t passwdlen, byte *nonce, size_t noncelen);
|
byte * pcp_scrypt(PCPCTX *ptx, char *passwd, size_t passwdlen, byte *nonce, size_t noncelen);
|
||||||
|
|
||||||
@@ -867,63 +858,7 @@ uint8_t *zmq_z85_decode (uint8_t *dest, char *string);
|
|||||||
char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);'''
|
char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);'''
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_ZFILE_FOOTER = "----- END Z85 ENCODED FILE -----"
|
PCP_ENFILE_FOOTER = "\r\n----- END PCP ENCRYPTED FILE -----\r\n"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_VAULT_ID = 14
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_FORMAT_PBP = 2
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SIG_SUB_KEYFLAGS = 27
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_SIG_END = "----- END ED25519 SIGNATURE -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SIG_CIPHER_NAME = "ED25519"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_PK_HEADER = "----- BEGIN ED25519-CURVE29915 PUBLIC KEY -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SK_FOOTER = "----- END ED25519-CURVE29915 PRIVATE KEY -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_ZFILE_HEADER = "----- BEGIN Z85 ENCODED FILE -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SIG_SUB_CTIME = 2
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_SIG_HEADER = "----- BEGIN ED25519 SIGNED MESSAGE -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SIG_SUB_KEYEXPIRE = 9
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PBP_COMPAT_SALT = "qa~t](84z<1t<1oz:ik.@IRNyhG=8q(on9}4#!/_h#a7wqK{Nt$T?W>,mt8NqYq&6U<GB1$,<$j>,rSYI2GRDd:Bcm"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_ASYM_CIPHER_ANON = 6
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SIG_TYPE = 0x1F
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
@@ -931,19 +866,11 @@ EXP_SIG_SUB_NOTATION = 20
|
|||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_SYM_CIPHER = 23
|
EXP_FORMAT_NATIVE = 1
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_CRYPTO_ADD = (32 - 16)
|
EXP_PK_CIPHER = 0x21
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_SIGPREFIX = "\nnacl-"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
PCP_RFC_CIPHER = 0x21
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
@@ -951,7 +878,19 @@ EXP_HASH_NAME = "BLAKE2"
|
|||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_ENFILE_FOOTER = "\r\n----- END PCP ENCRYPTED FILE -----\r\n"
|
PCP_SYM_CIPHER = 23
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_SIG_END = "----- END ED25519 SIGNATURE -----"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SK_HEADER = "----- BEGIN ED25519-CURVE29915 PRIVATE KEY -----"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_PK_HEADER = "----- BEGIN ED25519-CURVE29915 PUBLIC KEY -----"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
@@ -959,13 +898,77 @@ EXP_HASH_CIPHER = 0x22
|
|||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_ASYM_CIPHER_SIG = 24
|
EXP_SIG_SUB_KEYEXPIRE = 9
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_PK_CIPHER_NAME = "CURVE25519-ED25519-POLY1305-SALSA20"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_PK_FOOTER = "----- END ED25519-CURVE29915 PUBLIC KEY -----"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
EXP_SIG_CIPHER = 0x23
|
EXP_SIG_CIPHER = 0x23
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_SIG_HEADER = "----- BEGIN ED25519 SIGNED MESSAGE -----"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SIG_CIPHER_NAME = "ED25519"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_BLOCK_SIZE = 32 * 1024
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PBP_COMPAT_SALT = "qa~t](84z<1t<1oz:ik.@IRNyhG=8q(on9}4#!/_h#a7wqK{Nt$T?W>,mt8NqYq&6U<GB1$,<$j>,rSYI2GRDd:Bcm"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SIG_TYPE = 0x1F
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_FORMAT_PBP = 2
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SIG_SUB_SIGEXPIRE = 3
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_ASYM_CIPHER_ANON = 6
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SIG_SUB_CTIME = 2
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SIG_SUB_KEYFLAGS = 27
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_ME = "Pretty Curved Privacy"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_CRYPTO_ADD = (32 - 16)
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
EXP_SK_FOOTER = "----- END ED25519-CURVE29915 PRIVATE KEY -----"
|
||||||
|
|
||||||
|
|
||||||
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
|
PCP_VAULT_ID = 14
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_ENFILE_HEADER = "----- BEGIN PCP ENCRYPTED FILE -----\r\n"
|
PCP_ENFILE_HEADER = "----- BEGIN PCP ENCRYPTED FILE -----\r\n"
|
||||||
|
|
||||||
@@ -975,31 +978,23 @@ PCP_ASYM_CIPHER = 5
|
|||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
EXP_PK_CIPHER_NAME = "CURVE25519-ED25519-POLY1305-SALSA20"
|
PCP_ASYM_CIPHER_SIG = 24
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_SIG_START = "----- BEGIN ED25519 SIGNATURE -----"
|
PCP_RFC_CIPHER = 0x21
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_BLOCK_SIZE = 32 * 1024
|
PCP_ZFILE_FOOTER = "----- END Z85 ENCODED FILE -----"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
EXP_SIG_SUB_SIGEXPIRE = 3
|
PCP_SIGPREFIX = "\nnacl-"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
EXP_PK_FOOTER = "----- END ED25519-CURVE29915 PUBLIC KEY -----"
|
PCP_ZFILE_HEADER = "----- BEGIN Z85 ENCODED FILE -----"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_SK_HEADER = "----- BEGIN ED25519-CURVE29915 PRIVATE KEY -----"
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_FORMAT_NATIVE = 1
|
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
@@ -1007,8 +1002,4 @@ PCP_ENCRYPT_MAC = 56
|
|||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
||||||
PCP_ME = "Pretty Curved Privacy"
|
PCP_SIG_START = "----- BEGIN ED25519 SIGNATURE -----"
|
||||||
|
|
||||||
|
|
||||||
# ./gencffi.pl: from ../../include/pcp/defines.h:172
|
|
||||||
EXP_PK_CIPHER = 0x21
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ PCPEXPORT = pcp.h \
|
|||||||
pcp/crypto.h \
|
pcp/crypto.h \
|
||||||
pcp/config.h \
|
pcp/config.h \
|
||||||
pcp/defines.h \
|
pcp/defines.h \
|
||||||
pcp/getpass.h \
|
|
||||||
pcp/jenhash.h \
|
pcp/jenhash.h \
|
||||||
pcp/key.h \
|
pcp/key.h \
|
||||||
pcp/keyhash.h \
|
pcp/keyhash.h \
|
||||||
@@ -22,7 +21,7 @@ PCPEXPORT = pcp.h \
|
|||||||
pcp/context.h \
|
pcp/context.h \
|
||||||
pcp/structs.h \
|
pcp/structs.h \
|
||||||
pcp/util.h \
|
pcp/util.h \
|
||||||
pcp/plist.h \
|
pcp/readpass.h \
|
||||||
pcp/scrypt.h
|
pcp/scrypt.h
|
||||||
|
|
||||||
nobase_include_HEADERS = $(PCPEXPORT)
|
nobase_include_HEADERS = $(PCPEXPORT)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ extern "C" {
|
|||||||
#include "pcp/crypto.h"
|
#include "pcp/crypto.h"
|
||||||
#include "pcp/defines.h"
|
#include "pcp/defines.h"
|
||||||
#include "pcp/ed.h"
|
#include "pcp/ed.h"
|
||||||
#include "pcp/getpass.h"
|
|
||||||
#include "pcp/jenhash.h"
|
#include "pcp/jenhash.h"
|
||||||
#include "pcp/key.h"
|
#include "pcp/key.h"
|
||||||
#include "pcp/keyhash.h"
|
#include "pcp/keyhash.h"
|
||||||
@@ -22,6 +21,7 @@ extern "C" {
|
|||||||
#include "pcp/platform.h"
|
#include "pcp/platform.h"
|
||||||
#include "pcp/plist.h"
|
#include "pcp/plist.h"
|
||||||
#include "pcp/randomart.h"
|
#include "pcp/randomart.h"
|
||||||
|
#include "pcp/readpass.h"
|
||||||
#include "pcp/scrypt.h"
|
#include "pcp/scrypt.h"
|
||||||
#include "pcp/structs.h"
|
#include "pcp/structs.h"
|
||||||
#include "pcp/uthash.h"
|
#include "pcp/uthash.h"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#define PCP_VERSION_MAJOR 0
|
#define PCP_VERSION_MAJOR 0
|
||||||
#define PCP_VERSION_MINOR 3
|
#define PCP_VERSION_MINOR 3
|
||||||
#define PCP_VERSION_PATCH 0
|
#define PCP_VERSION_PATCH 1
|
||||||
|
|
||||||
#define PCP_VERSION PCP_MAKE_VERSION(PCP_VERSION_MAJOR, PCP_VERSION_MINOR, PCP_VERSION_PATCH)
|
#define PCP_VERSION PCP_MAKE_VERSION(PCP_VERSION_MAJOR, PCP_VERSION_MINOR, PCP_VERSION_PATCH)
|
||||||
#define PCP_MAKE_VERSION(major, minor, patch) ((major * 10000) + (minor * 100) + (patch))
|
#define PCP_MAKE_VERSION(major, minor, patch) ((major * 10000) + (minor * 100) + (patch))
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#
|
#
|
||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
AM_CFLAGS = -I../include/pcp -Iscrypt/util
|
AM_CFLAGS = -I../include/pcp
|
||||||
|
|
||||||
lib_LTLIBRARIES = libpcp1.la
|
lib_LTLIBRARIES = libpcp1.la
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ pkgconfig_DATA = libpcp1.pc
|
|||||||
|
|
||||||
libpcp1_la_SOURCES = platform.c mem.c version.c \
|
libpcp1_la_SOURCES = platform.c mem.c version.c \
|
||||||
context.c z85.c zmq_z85.c key.c randomart.c \
|
context.c z85.c zmq_z85.c key.c randomart.c \
|
||||||
vault.c jenhash.c \
|
vault.c jenhash.c readpass.c \
|
||||||
crypto.c ed.c keyhash.c scrypt.c \
|
crypto.c ed.c keyhash.c scrypt.c \
|
||||||
util.c buffer.c mgmt.c keysig.c pcpstream.c
|
util.c buffer.c mgmt.c keysig.c pcpstream.c
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
AM_CFLAGS = -I../include/pcp -I../libpcp/scrypt/crypto
|
AM_CFLAGS = -I../include/pcp
|
||||||
|
|
||||||
EXTRA_DIST = *.h
|
EXTRA_DIST = *.h
|
||||||
|
|
||||||
bin_PROGRAMS = pcp1
|
bin_PROGRAMS = pcp1
|
||||||
|
|
||||||
pcp1_LDADD = ../libpcp/.libs/libpcp1.a
|
pcp1_LDADD = ../libpcp/.libs/libpcp1.a
|
||||||
pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c \
|
pcp1_SOURCES = pcp.c keymgmt.c keyprint.c \
|
||||||
encryption.c z85util.c signature.c \
|
encryption.c z85util.c signature.c \
|
||||||
compat_getopt.c
|
compat_getopt.c
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
|
|||||||
|
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase for symetric decryption", NULL, 1, NULL);
|
"Enter passphrase for symetric decryption", NULL, 1, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -99,7 +99,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
|
|||||||
/* encrypted, decrypt it */
|
/* encrypted, decrypt it */
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -135,6 +135,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
|
|||||||
else {
|
else {
|
||||||
dlen = pcp_decrypt_stream(ptx, pin, pout, NULL, symkey, verify, 0);
|
dlen = pcp_decrypt_stream(ptx, pin, pout, NULL, symkey, verify, 0);
|
||||||
sfree(symkey);
|
sfree(symkey);
|
||||||
|
symkey = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps_close(pin);
|
ps_close(pin);
|
||||||
@@ -151,7 +152,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i
|
|||||||
|
|
||||||
errde3:
|
errde3:
|
||||||
if(symkey != NULL)
|
if(symkey != NULL)
|
||||||
free(symkey);
|
sfree(symkey);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -173,7 +174,7 @@ int pcpencrypt(char *id, char *infile, char *outfile, char *passwd, plist_t *rec
|
|||||||
symmode = 1;
|
symmode = 1;
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase for symetric encryption", "Repeat passphrase", 1, NULL);
|
"Enter passphrase for symetric encryption", "Repeat passphrase", 1, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -267,7 +268,7 @@ int pcpencrypt(char *id, char *infile, char *outfile, char *passwd, plist_t *rec
|
|||||||
/* encrypted, decrypt it */
|
/* encrypted, decrypt it */
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ void pcp_keygen(char *passwd) {
|
|||||||
|
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase for key encryption",
|
"Enter passphrase for key encryption",
|
||||||
"Enter the passphrase again", 1, NULL);
|
"Enter the passphrase again", 1, NULL);
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,7 @@ void pcp_exportsecret(char *keyid, int useid, char *outfile, int armor, char *pa
|
|||||||
/* decrypt the secret key */
|
/* decrypt the secret key */
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
||||||
key = pcpkey_decrypt(ptx, key, passphrase);
|
key = pcpkey_decrypt(ptx, key, passphrase);
|
||||||
if(key == NULL) {
|
if(key == NULL) {
|
||||||
@@ -254,7 +254,7 @@ void pcp_exportsecret(char *keyid, int useid, char *outfile, int armor, char *pa
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to encrypt the exported secret key",
|
"Enter passphrase to encrypt the exported secret key",
|
||||||
"Repeat passphrase", 1, NULL);
|
"Repeat passphrase", 1, NULL);
|
||||||
exported_sk = pcp_export_secret(ptx, key, passphrase);
|
exported_sk = pcp_export_secret(ptx, key, passphrase);
|
||||||
@@ -344,7 +344,7 @@ void pcp_exportpublic(char *keyid, char *passwd, char *outfile, int format, int
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
||||||
sk = pcpkey_decrypt(ptx, sk, passphrase);
|
sk = pcpkey_decrypt(ptx, sk, passphrase);
|
||||||
sfree(passphrase);
|
sfree(passphrase);
|
||||||
@@ -431,7 +431,7 @@ void pcpedit_key(char *keyid) {
|
|||||||
if(key != NULL) {
|
if(key != NULL) {
|
||||||
if(key->secret[0] == 0) {
|
if(key->secret[0] == 0) {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase, "Enter passphrase to decrypt the key", NULL, 1, NULL);
|
pcp_readpass(ptx, &passphrase, "Enter passphrase to decrypt the key", NULL, 1, NULL);
|
||||||
key = pcpkey_decrypt(ptx, key, passphrase);
|
key = pcpkey_decrypt(ptx, key, passphrase);
|
||||||
sfree(passphrase);
|
sfree(passphrase);
|
||||||
}
|
}
|
||||||
@@ -482,7 +482,7 @@ void pcpedit_key(char *keyid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter new passphrase for key encryption (press enter to keep current)",
|
"Enter new passphrase for key encryption (press enter to keep current)",
|
||||||
"Enter the passphrase again", 1, NULL);
|
"Enter the passphrase again", 1, NULL);
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ int pcp_import (vault_t *vault, FILE *in, char *passwd) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt the secret key file", NULL, 1, NULL);
|
"Enter passphrase to decrypt the secret key file", NULL, 1, NULL);
|
||||||
sk = pcp_import_secret(ptx, buf, bufsize, passphrase);
|
sk = pcp_import_secret(ptx, buf, bufsize, passphrase);
|
||||||
sfree(passphrase);
|
sfree(passphrase);
|
||||||
@@ -617,7 +617,7 @@ int pcp_import (vault_t *vault, FILE *in, char *passwd) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase for key encryption",
|
"Enter passphrase for key encryption",
|
||||||
"Enter the passphrase again", 1, NULL);
|
"Enter the passphrase again", 1, NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ int pcpsign(char *infile, char *outfile, char *passwd, int z85, int detach) {
|
|||||||
/* encrypted, decrypt it */
|
/* encrypted, decrypt it */
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
if(passwd == NULL) {
|
if(passwd == NULL) {
|
||||||
pcp_readpass(&passphrase,
|
pcp_readpass(ptx, &passphrase,
|
||||||
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
"Enter passphrase to decrypt your secret key", NULL, 1, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if BUILDJSON
|
|||||||
MAYJSON=jsontest
|
MAYJSON=jsontest
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AM_CFLAGS = -I../include/pcp -I../src -I../libpcp/scrypt/crypto
|
AM_CFLAGS = -I../include/pcp -I../src
|
||||||
check_PROGRAMS = invalidkeys gencheader statictest $(CPPTEST) \
|
check_PROGRAMS = invalidkeys gencheader statictest $(CPPTEST) \
|
||||||
buffertest sample streamtest pipetest decodertest mangle
|
buffertest sample streamtest pipetest decodertest mangle
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ mangle_LDADD =
|
|||||||
mangle_SOURCES = mangle.c
|
mangle_SOURCES = mangle.c
|
||||||
|
|
||||||
invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a \
|
invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a \
|
||||||
../src/keyprint.o ../src/keymgmt.o ../src/readpass.o
|
../src/keyprint.o ../src/keymgmt.o
|
||||||
invalidkeys_SOURCES = invalidkeys.c
|
invalidkeys_SOURCES = invalidkeys.c
|
||||||
|
|
||||||
if BUILDCPP
|
if BUILDCPP
|
||||||
|
|||||||
Reference in New Issue
Block a user