summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog8
-rw-r--r--g10/misc.c73
-rw-r--r--g10/sign.c5
3 files changed, 9 insertions, 77 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 5e0a29062..b49d8868b 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-20 Werner Koch <wk@g10code.com>
+
+ * misc.c (setsysinfo, trap_unaligned): Remove. It is also in
+ common/sysutils.c.
+ (disable_core_dumps, get_session_marker):
+
+ * sign.c (sleep): Remove sleep wrapper.
+
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.
diff --git a/g10/misc.c b/g10/misc.c
index c743da614..4cb7191e5 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -94,51 +94,6 @@ static struct secured_file_item *secured_files;
-#if defined(__linux__) && defined(__alpha__) && __GLIBC__ < 2
-static int
-setsysinfo(unsigned long op, void *buffer, unsigned long size,
- int *start, void *arg, unsigned long flag)
-{
- return syscall(__NR_osf_setsysinfo, op, buffer, size, start, arg, flag);
-}
-
-void
-trap_unaligned(void)
-{
- unsigned int buf[2];
-
- buf[0] = SSIN_UACPROC;
- buf[1] = UAC_SIGBUS | UAC_NOPRINT;
- setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0, 0);
-}
-#else
-void
-trap_unaligned(void)
-{ /* dummy */
-}
-#endif
-
-
-int
-disable_core_dumps()
-{
-#ifdef HAVE_DOSISH_SYSTEM
- return 0;
-#else
-#ifdef HAVE_SETRLIMIT
- struct rlimit limit;
-
- limit.rlim_cur = 0;
- limit.rlim_max = 0;
- if( !setrlimit( RLIMIT_CORE, &limit ) )
- return 0;
- if( errno != EINVAL && errno != ENOSYS )
- log_fatal(_("can't disable core dumps: %s\n"), strerror(errno) );
-#endif
- return 1;
-#endif
-}
-
/* For the sake of SELinux we want to restrict access through gpg to
certain files we keep under our own control. This function
@@ -371,34 +326,6 @@ print_digest_algo_note( int algo )
gcry_md_algo_name (algo));
}
-/* Return a string which is used as a kind of process ID */
-const byte *
-get_session_marker( size_t *rlen )
-{
- static byte marker[SIZEOF_UNSIGNED_LONG*2];
- static int initialized;
-
- if ( !initialized )
- {
- volatile ulong aa, bb; /* We really want the uninitialized value. */
- ulong a, b;
-
- initialized = 1;
- /* Although this marker is guessable it is not easy to use this
- * for a faked control packet because an attacker does not have
- * enough control about the time the verification takes place.
- * Of course, we could add just more random but than we need the
- * random generator even for verification tasks - which does not
- * make sense. */
- a = aa ^ (ulong)getpid();
- b = bb ^ (ulong)time(NULL);
- memcpy ( marker, &a, SIZEOF_UNSIGNED_LONG );
- memcpy ( marker+SIZEOF_UNSIGNED_LONG, &b, SIZEOF_UNSIGNED_LONG );
- }
- *rlen = sizeof(marker);
- return marker;
-}
-
/****************
* Wrapper around the libgcrypt function with additonal checks on
* the OpenPGP contraints for the algo ID.
diff --git a/g10/sign.c b/g10/sign.c
index 062fa9f48..1a1a80bc6 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -26,7 +26,6 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
-#include <unistd.h> /* need sleep() */
#include "gpg.h"
#include "options.h"
@@ -47,8 +46,6 @@
#ifdef HAVE_DOSISH_SYSTEM
#define LF "\r\n"
-void __stdcall Sleep(ulong);
-#define sleep(a) Sleep((a)*1000)
#else
#define LF "\n"
#endif
@@ -1563,7 +1560,7 @@ update_keysig_packet( PKT_signature **ret_sig,
one. */
while(sig->timestamp<=orig_sig->timestamp)
{
- sleep(1);
+ gnupg_sleep (1);
sig->timestamp=make_timestamp();
}