mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* g10.c, options.h: Removed option --emulate-checksum-bug.
* misc.c (checksum_u16_nobug): Removed. (checksum_u16): Removed the bug emulation. (checksum_mpi): Ditto. (checksum_mpi_counted_nbits): Removed and replaced all calls with checksum_mpi. * parse-packet.c (read_protected_v3_mpi): New. (parse_key): Use it here to store it as an opaque MPI. * seckey-cert.c (do_check): Changed the v3 unprotection to the new why to store these keys. (protect_secret_key): Likewise. * build-packet.c (do_secret_key): And changed the writing.
This commit is contained in:
parent
c30d7e8dc7
commit
c5445cc323
10 changed files with 152 additions and 126 deletions
24
g10/tdbio.c
24
g10/tdbio.c
|
@ -43,6 +43,13 @@
|
|||
#define ftruncate chsize
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
#define MY_O_BINARY O_BINARY
|
||||
#else
|
||||
#define MY_O_BINARY 0
|
||||
#endif
|
||||
|
||||
|
||||
/****************
|
||||
* Yes, this is a very simple implementation. We should really
|
||||
* use a page aligned buffer and read complete pages.
|
||||
|
@ -484,11 +491,7 @@ tdbio_set_dbname( const char *new_dbname, int create )
|
|||
if( !fp )
|
||||
log_fatal( _("%s: can't create: %s\n"), fname, strerror(errno) );
|
||||
fclose(fp);
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
db_fd = open( db_name, O_RDWR | O_BINARY );
|
||||
#else
|
||||
db_fd = open( db_name, O_RDWR );
|
||||
#endif
|
||||
db_fd = open( db_name, O_RDWR | MY_O_BINARY );
|
||||
if( db_fd == -1 )
|
||||
log_fatal( _("%s: can't open: %s\n"), db_name, strerror(errno) );
|
||||
|
||||
|
@ -544,11 +547,12 @@ open_db()
|
|||
if (make_dotlock( lockhandle, -1 ) )
|
||||
log_fatal( _("%s: can't make lock\n"), db_name );
|
||||
#endif /* __riscos__ */
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
db_fd = open (db_name, O_RDWR | O_BINARY );
|
||||
#else
|
||||
db_fd = open (db_name, O_RDWR );
|
||||
#endif
|
||||
db_fd = open (db_name, O_RDWR | MY_O_BINARY );
|
||||
if (db_fd == -1 && errno == EACCES) {
|
||||
db_fd = open (db_name, O_RDONLY | MY_O_BINARY );
|
||||
if (db_fd != -1)
|
||||
log_info (_("NOTE: trustdb not writable\n"));
|
||||
}
|
||||
if ( db_fd == -1 )
|
||||
log_fatal( _("%s: can't open: %s\n"), db_name, strerror(errno) );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue