summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2000-07-28 18:19:07 +0200
committerWerner Koch <wk@gnupg.org>2000-07-28 18:19:07 +0200
commitd81c3f733ba813dae4fc6bed6073551449dcc65c (patch)
treedc0bc70f697b7b4623d359b172cae2b035347aa3 /g10
parentSee ChangeLog: Tue Jul 25 17:44:15 CEST 2000 Werner Koch (diff)
downloadgnupg2-d81c3f733ba813dae4fc6bed6073551449dcc65c.tar.xz
gnupg2-d81c3f733ba813dae4fc6bed6073551449dcc65c.zip
See ChangeLog: Fri Jul 28 18:19:11 CEST 2000 Werner Koch
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog8
-rw-r--r--g10/gpg.c9
-rw-r--r--g10/keygen.c7
-rw-r--r--g10/plaintext.c7
-rw-r--r--g10/sig-check.c2
5 files changed, 31 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 893fed136..16abe9421 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,11 @@
+Fri Jul 28 18:19:11 CEST 2000 Werner Koch <wk@openit.de>
+
+ * sig-check.c (pk_verify): Fixed the S-Exp withe the pkey.
+
+ * gpg.c (main): Use setmode(O_BINARY) for MSDOS while generating random bytes
+ (print_mds): Likewise for stdin.
+ * plaintext.c (handle_plaintext): Likewise for stdout.
+
Tue Jul 25 17:44:15 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c (menu_expire): expire date for primary key can be set again.
diff --git a/g10/gpg.c b/g10/gpg.c
index fb1be046f..11ceb810d 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -25,6 +25,9 @@
#include <string.h>
#include <ctype.h>
#include <unistd.h>
+#ifdef HAVE_DOSISH_SYSTEM
+ #include <fcntl.h> /* for setmode() */
+#endif
#include <gcrypt.h>
@@ -1449,6 +1452,9 @@ main( int argc, char **argv )
size_t n = !endless && count < 100? count : 100;
p = gcry_random_bytes( n, level );
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(stdout), O_BINARY );
+ #endif
fwrite( p, n, 1, stdout );
gcry_free(p);
if( !endless )
@@ -1676,6 +1682,9 @@ print_mds( const char *fname, int algo, const char *key )
if( !fname ) {
fp = stdin;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
pname = gcry_xstrdup("[stdin]: ");
}
else {
diff --git a/g10/keygen.c b/g10/keygen.c
index 3b3d95e3b..3e22d05d0 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -254,7 +254,7 @@ key_from_sexp( GCRY_MPI *array,
list = gcry_sexp_find_token( sexp, topname, 0 );
if( !list )
return GCRYERR_INV_OBJ;
- l2 = gcry_sexp_cdr( list );
+ l2 = gcry_sexp_cadr( list );
gcry_sexp_release ( list );
list = l2;
if( !list )
@@ -311,6 +311,7 @@ factors_from_sexp( MPI **retarray, GCRY_SEXP sexp )
if( !list )
return GCRYERR_NO_OBJ;
+ #if 0
/* count factors */
ctx = NULL;
for( n=0; (l2 = gcry_sexp_enum( list, &ctx, 0 )); n++ )
@@ -337,6 +338,10 @@ factors_from_sexp( MPI **retarray, GCRY_SEXP sexp )
}
}
}
+ #else
+ array = gcry_xcalloc( 1, sizeof *array );
+ #warning dummy code here
+ #endif
gcry_sexp_release ( list );
*retarray = array;
diff --git a/g10/plaintext.c b/g10/plaintext.c
index e3c7a865c..555dd1636 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -24,6 +24,10 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
+#ifdef HAVE_DOSISH_SYSTEM
+ #include <fcntl.h> /* for setmode() */
+#endif
+
#include "util.h"
#include <gcrypt.h>
#include "options.h"
@@ -81,6 +85,9 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
else if( !*fname || (*fname=='-' && !fname[1])) {
/* no filename or "-" given; write to stdout */
fp = stdout;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
}
else if( !overwrite_filep( fname ) ) {
rc = GPGERR_CREATE_FILE;
diff --git a/g10/sig-check.c b/g10/sig-check.c
index ba392414a..85c8bfbc1 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -67,7 +67,7 @@ pk_verify( int algo, MPI hash, MPI *data, MPI *pkey,
}
else if( algo == GCRY_PK_ELG || algo == GCRY_PK_ELG_E ) {
rc = gcry_sexp_build ( &s_pkey, NULL,
- "(public-key(dsa(p%m)(g%m)(y%m)))",
+ "(public-key(elg(p%m)(g%m)(y%m)))",
pkey[0], pkey[1], pkey[2] );
}
else if( algo == GCRY_PK_RSA ) {