updated pod

This commit is contained in:
git@daemon.de
2014-02-07 11:55:44 +01:00
parent 181c5ddac4
commit 7f4bccfaff
9 changed files with 265 additions and 20 deletions

View File

@@ -105,7 +105,7 @@ To learn how to use B<pcp>, read the manpage:
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2013 by T.Linden <tom AT cpan DOT org> Copyright (c) 2013-2014 by T.v.Dein <tom AT vondein DOT org>
=head1 ADDITIONAL COPYRIGHTS =head1 ADDITIONAL COPYRIGHTS
@@ -144,7 +144,7 @@ under the B<GPL> as well.
=head1 AUTHORS =head1 AUTHORS
I<T.Linden <tom AT cpan DOT org>> I<T.v.Dein <tom AT vondein DOT org>>
=head1 LICENSE =head1 LICENSE

View File

@@ -97,7 +97,7 @@ DOCUMENTATION
man pcp1 man pcp1
COPYRIGHT COPYRIGHT
Copyright (c) 2013 by T.Linden <tom AT cpan DOT org> Copyright (c) 2013-2014 by T.v.Dein <tom AT vondein DOT org>
ADDITIONAL COPYRIGHTS ADDITIONAL COPYRIGHTS
ZeroMQ Z85 encoding routine ZeroMQ Z85 encoding routine
@@ -125,7 +125,7 @@ ADDITIONAL COPYRIGHTS
as well. as well.
AUTHORS AUTHORS
*T.Linden <tom AT cpan DOT org*> *T.v.Dein <tom AT vondein DOT org*>
LICENSE LICENSE
Licensed under the GNU GENERAL PUBLIC LICENSE version 3. Licensed under the GNU GENERAL PUBLIC LICENSE version 3.

View File

@@ -6,6 +6,7 @@ extern "C" {
#endif #endif
#include "pcp/base85.h" #include "pcp/base85.h"
#include "pcp/config.h"
#include "pcp/crypto.h" #include "pcp/crypto.h"
#include "pcp/defines.h" #include "pcp/defines.h"
#include "pcp/digital_crc32.h" #include "pcp/digital_crc32.h"

View File

@@ -1,4 +1,3 @@
# -*-perl-*-
=head1 PCP1 KEYS =head1 PCP1 KEYS
@@ -153,11 +152,84 @@ encrypted file without a signature, decryption will fail as well.>
Note: this behavior might change in the future. Note: this behavior might change in the future.
=head1 VULNERABILITIES =head1 ALTERNATIVE COMMANDLINES
Currently there are a couple of problems which are not You can save typing if you supply additional arguments to
addressed. These are usually protocol problems, which are pcp after commandline options. Such arguments are treated
not caused by pcp1. as filenames or recipients, depending what options you already
specified.
Here is a list of commandlines and their possible alternatives:
ORIGINAL ALTERNATIVE DESCRIPTION
pcp -e -I message -r Bob pcp -e -r Bob message use 'message' as inputfile.
pcp -e -I message Bob use 'Bob' as recipient,
multiple recipients supported.
pcp -d -I crypted pcp -d crypted use 'crypted' as inputfile.
pcp -g -I message pcp -g message use 'message' as inputfile.
pcp -g -I msg -O sig pcp -g -I msg sig use 'sig' as outputfile.
pcp -p -O key.pcp pcp -p key.pcp use 'key.pcp' as outputfile.
pcp -p -O key.pcp -r Bob pcp -p -O key.pcp Bob use 'Bob' as recipient.
pcp -s -O key.pcp pcp -s key.pcp use 'key.pcp' as outputfile.
pcp -s -O key.pcp -r Bob pcp -s -O key.pcp Bob use 'Bob' as recipient.
pcp -P -I alice.pcp pcp -P alice.pcp use 'alice.pcp' as inputfile.
pcp -S -I alice.pcp pcp -S alice.pcp use 'alice.pcp' as inputfile.
=head1 ENVIRONMENT VARIABLES
pcp respects the following environment variables:
=over
=item B<PCP_VAULT>
Use an alternative vaultfile. The default is B<~/.pcpvault> and
can be overridden with the B<-V> commandline option. If PCP_VAULT
is set, this one will be used instead.
=item B<PCP_DEBUG>
Enable debugging output, where supported. Same as B<-D>.
=back
=head1 EXIT STATUS
Pcp may return one of several error codes if it encounters problems.
=over
=item 0 No problems occurred.
=item 1 Generic error code.
=back
=head1 FILES
=over
=item B<~/.pcpvault>
Default vault file where all keys are stored.
=back
=head1 EXPERIMENTAL STATUS
Currently there are a couple of problems which are currently
unsolved or in the process to be solved.
=over =over
@@ -523,4 +595,5 @@ outlined above into account>.
PCP tries to be fully compatible with PBP (https://github.com/stef/pbp). Encrypted PCP tries to be fully compatible with PBP (https://github.com/stef/pbp). Encrypted
files and signatures - at least their binary versions - should be exchangable. However, files and signatures - at least their binary versions - should be exchangable. However,
this is a work in progress and might not work under all circumstances. Also there's currently this is a work in progress and might not work under all circumstances. Also there's currently
no shared key format between pbp and pcp. no shared key format between pbp and pcp. However, it is possible to export and
import pbp keys from/to pcp.

View File

@@ -1,7 +1,7 @@
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2013 by T.Linden <tom AT cpan DOT org> Copyright (c) 2013-2014 by T.v.Dein <tom AT vondein DOT org>
=head1 ADDITIONAL COPYRIGHTS =head1 ADDITIONAL COPYRIGHTS
@@ -40,7 +40,7 @@ under the B<GPL> as well.
=head1 AUTHORS =head1 AUTHORS
I<T.Linden <tom AT cpan DOT org>> I<T.v.Dein <tom AT vondein DOT org>>
=head1 LICENSE =head1 LICENSE

View File

@@ -11,6 +11,7 @@ Pretty Curved Privacy - File encryption using eliptic curve cryptography.
[ --export-public | --export-secret | --import-public | --import-secret ] [ --export-public | --export-secret | --import-public | --import-secret ]
[ --encrypt | --decrypt ] [ --encrypt | --decrypt ]
[ --sign | --check-signature ] [ --sign | --check-signature ]
[ arguments ]
General Options: General Options:
-h --help Print this help message. -h --help Print this help message.
@@ -47,6 +48,11 @@ Pretty Curved Privacy - File encryption using eliptic curve cryptography.
Encoding Options: Encoding Options:
-z --z85-encode Armor with Z85 encoding. -z --z85-encode Armor with Z85 encoding.
Arguments:
Extra arguments after options are treated as filenames or
recipients, depending on operation mode.
=head1 OPTIONS =head1 OPTIONS
Usage: pcp1 [options] Usage: pcp1 [options]
@@ -235,7 +241,6 @@ Oh - and if you're wondering why I named them Alicia and Bobby:
I was just sick of Alice and Bob. We're running NSA-free, so we're I was just sick of Alice and Bob. We're running NSA-free, so we're
using other sample names as well. using other sample names as well.
# -*-perl-*-
=head1 PCP1 KEYS =head1 PCP1 KEYS
@@ -390,11 +395,84 @@ encrypted file without a signature, decryption will fail as well.>
Note: this behavior might change in the future. Note: this behavior might change in the future.
=head1 VULNERABILITIES =head1 ALTERNATIVE COMMANDLINES
Currently there are a couple of problems which are not You can save typing if you supply additional arguments to
addressed. These are usually protocol problems, which are pcp after commandline options. Such arguments are treated
not caused by pcp1. as filenames or recipients, depending what options you already
specified.
Here is a list of commandlines and their possible alternatives:
ORIGINAL ALTERNATIVE DESCRIPTION
pcp -e -I message -r Bob pcp -e -r Bob message use 'message' as inputfile.
pcp -e -I message Bob use 'Bob' as recipient,
multiple recipients supported.
pcp -d -I crypted pcp -d crypted use 'crypted' as inputfile.
pcp -g -I message pcp -g message use 'message' as inputfile.
pcp -g -I msg -O sig pcp -g -I msg sig use 'sig' as outputfile.
pcp -p -O key.pcp pcp -p key.pcp use 'key.pcp' as outputfile.
pcp -p -O key.pcp -r Bob pcp -p -O key.pcp Bob use 'Bob' as recipient.
pcp -s -O key.pcp pcp -s key.pcp use 'key.pcp' as outputfile.
pcp -s -O key.pcp -r Bob pcp -s -O key.pcp Bob use 'Bob' as recipient.
pcp -P -I alice.pcp pcp -P alice.pcp use 'alice.pcp' as inputfile.
pcp -S -I alice.pcp pcp -S alice.pcp use 'alice.pcp' as inputfile.
=head1 ENVIRONMENT VARIABLES
pcp respects the following environment variables:
=over
=item B<PCP_VAULT>
Use an alternative vaultfile. The default is B<~/.pcpvault> and
can be overridden with the B<-V> commandline option. If PCP_VAULT
is set, this one will be used instead.
=item B<PCP_DEBUG>
Enable debugging output, where supported. Same as B<-D>.
=back
=head1 EXIT STATUS
Pcp may return one of several error codes if it encounters problems.
=over
=item 0 No problems occurred.
=item 1 Generic error code.
=back
=head1 FILES
=over
=item B<~/.pcpvault>
Default vault file where all keys are stored.
=back
=head1 EXPERIMENTAL STATUS
Currently there are a couple of problems which are currently
unsolved or in the process to be solved.
=over =over
@@ -760,11 +838,12 @@ outlined above into account>.
PCP tries to be fully compatible with PBP (https://github.com/stef/pbp). Encrypted PCP tries to be fully compatible with PBP (https://github.com/stef/pbp). Encrypted
files and signatures - at least their binary versions - should be exchangable. However, files and signatures - at least their binary versions - should be exchangable. However,
this is a work in progress and might not work under all circumstances. Also there's currently this is a work in progress and might not work under all circumstances. Also there's currently
no shared key format between pbp and pcp. no shared key format between pbp and pcp. However, it is possible to export and
import pbp keys from/to pcp.
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright (c) 2013 by T.Linden <tom AT cpan DOT org> Copyright (c) 2013-2014 by T.v.Dein <tom AT vondein DOT org>
=head1 ADDITIONAL COPYRIGHTS =head1 ADDITIONAL COPYRIGHTS
@@ -803,7 +882,7 @@ under the B<GPL> as well.
=head1 AUTHORS =head1 AUTHORS
I<T.Linden <tom AT cpan DOT org>> I<T.v.Dein <tom AT vondein DOT org>>
=head1 LICENSE =head1 LICENSE

View File

@@ -54,6 +54,7 @@ int main (int argc, char **argv) {
char *keyid = NULL; char *keyid = NULL;
char *id = NULL; char *id = NULL;
char *xpass = NULL; char *xpass = NULL;
char *extra = NULL;
plist_t *recipient = NULL; plist_t *recipient = NULL;
FILE *in; FILE *in;
@@ -263,6 +264,85 @@ int main (int argc, char **argv) {
mode = PCP_MODE_ENCRYPT_ME; mode = PCP_MODE_ENCRYPT_ME;
} }
if(argc >= 1) {
/* ok, there are arguments left on the commandline.
treat it as filename or recipient, depending on
current mode and other given parameters */
extra = ucmalloc(strlen(argv[0])+1);
strncpy(extra, argv[0], strlen(argv[0])+1);
switch (mode) {
case PCP_MODE_DECRYPT:
if(infile == NULL)
infile = extra;
break;
case PCP_MODE_ENCRYPT:
if(infile == NULL)
infile = extra;
else if(userec == 0 && useid == 0) {
userec = 1;
int i;
for (i=0; i<argc; i++) {
p_add(&recipient, argv[i]);
}
free(extra);
}
break;
case PCP_MODE_IMPORT_PUBLIC:
case PCP_MODE_IMPORT_SECRET:
if(infile == NULL)
infile = extra;
break;
case PCP_MODE_EXPORT_SECRET:
case PCP_MODE_EXPORT_PUBLIC:
if(outfile == NULL)
outfile = extra;
else if(useid == 0 && userec == 0) {
p_add(&recipient, extra);
userec = 1;
}
break;
case PCP_MODE_VERIFY:
if(infile == NULL)
infile = extra;
else if (useid == 0) {
id = extra;
useid = 1;
}
break;
case PCP_MODE_SIGN:
if(infile == NULL)
infile = extra;
else if(outfile == NULL && detach == 0)
outfile = extra;
break;
default:
free(extra); /* not used */
}
}
/* check if there's some enviroment we could use */
if(usevault == 1) {
char *_vaultfile = getenv("PCP_VAULT");
if(_vaultfile != NULL) {
strncpy(vaultfile, _vaultfile, strlen(_vaultfile)+1);
}
}
if(debug == 0) {
char *_debug = getenv("PCP_DEBUG");
if(_debug != NULL) {
debug = 1;
}
}
if(usevault == 1) { if(usevault == 1) {
pcphash_init(); pcphash_init();
vault = pcpvault_init(vaultfile); vault = pcpvault_init(vaultfile);

View File

@@ -6,6 +6,7 @@
" [ --export-public | --export-secret | --import-public | --import-secret ]\n" \ " [ --export-public | --export-secret | --import-public | --import-secret ]\n" \
" [ --encrypt | --decrypt ]\n" \ " [ --encrypt | --decrypt ]\n" \
" [ --sign | --check-signature ]\n" \ " [ --sign | --check-signature ]\n" \
" [ arguments ]\n" \
"\n" \ "\n" \
"General Options:\n" \ "General Options:\n" \
"-h --help Print this help message.\n" \ "-h --help Print this help message.\n" \
@@ -42,5 +43,10 @@
"\n" \ "\n" \
"Encoding Options:\n" \ "Encoding Options:\n" \
"-z --z85-encode Armor with Z85 encoding.\n" \ "-z --z85-encode Armor with Z85 encoding.\n" \
"\n" \
"Arguments:\n" \
"Extra arguments after options are treated as filenames or\n" \
"recipients, depending on operation mode.\n" \
"\n" \
"\n" "\n"
#endif #endif

View File

@@ -4,6 +4,7 @@ Usage: pcp1 [ --help | --version ]
[ --export-public | --export-secret | --import-public | --import-secret ] [ --export-public | --export-secret | --import-public | --import-secret ]
[ --encrypt | --decrypt ] [ --encrypt | --decrypt ]
[ --sign | --check-signature ] [ --sign | --check-signature ]
[ arguments ]
General Options: General Options:
-h --help Print this help message. -h --help Print this help message.
@@ -40,3 +41,8 @@ Signature Options:
Encoding Options: Encoding Options:
-z --z85-encode Armor with Z85 encoding. -z --z85-encode Armor with Z85 encoding.
Arguments:
Extra arguments after options are treated as filenames or
recipients, depending on operation mode.