diff options
Diffstat (limited to 'libgcrypt-1.4.6')
| -rw-r--r-- | libgcrypt-1.4.6/cipher/cipher.c | 8 | ||||
| -rw-r--r-- | libgcrypt-1.4.6/random/random-csprng.c | 26 | ||||
| -rw-r--r-- | libgcrypt-1.4.6/src/gcrypt.h | 12 |
3 files changed, 23 insertions, 23 deletions
diff --git a/libgcrypt-1.4.6/cipher/cipher.c b/libgcrypt-1.4.6/cipher/cipher.c index 1948b91..8bc7aa2 100644 --- a/libgcrypt-1.4.6/cipher/cipher.c +++ b/libgcrypt-1.4.6/cipher/cipher.c @@ -321,11 +321,11 @@ gcry_cipher_lookup_func_name (void *spec, void *data) gcry_cipher_spec_t *cipher = (gcry_cipher_spec_t *) spec;
char *name = (char *) data;
const char **aliases = cipher->aliases;
- int i, ret = ! stricmp (name, cipher->name);
+ int i, ret = ! _stricmp (name, cipher->name);
if (aliases)
for (i = 0; aliases[i] && (! ret); i++)
- ret = ! stricmp (name, aliases[i]);
+ ret = ! _stricmp (name, aliases[i]);
return ret;
}
@@ -341,7 +341,7 @@ gcry_cipher_lookup_func_oid (void *spec, void *data) if (oid_specs)
for (i = 0; oid_specs[i].oid && (! ret); i++)
- if (! stricmp (oid, oid_specs[i].oid))
+ if (! _stricmp (oid, oid_specs[i].oid))
ret = 1;
return ret;
@@ -437,7 +437,7 @@ search_oid (const char *oid, int *algorithm, gcry_cipher_oid_spec_t *oid_spec) int i;
for (i = 0; cipher->oids[i].oid && !ret; i++)
- if (! stricmp (oid, cipher->oids[i].oid))
+ if (! _stricmp (oid, cipher->oids[i].oid))
{
if (algorithm)
*algorithm = module->mod_id;
diff --git a/libgcrypt-1.4.6/random/random-csprng.c b/libgcrypt-1.4.6/random/random-csprng.c index 2e07dc3..ea446ac 100644 --- a/libgcrypt-1.4.6/random/random-csprng.c +++ b/libgcrypt-1.4.6/random/random-csprng.c @@ -746,7 +746,7 @@ read_seed_file (void) return 0;
#ifdef HAVE_DOSISH_SYSTEM
- fd = open( seed_file_name, O_RDONLY | O_BINARY );
+ fd = _open( seed_file_name, O_RDONLY | O_BINARY );
#else
fd = open( seed_file_name, O_RDONLY );
#endif
@@ -763,49 +763,49 @@ read_seed_file (void) }
if (lock_seed_file (fd, seed_file_name, 0))
{
- close (fd);
+ _close (fd);
return 0;
}
if (fstat( fd, &sb ) )
{
log_info(_("can't stat `%s': %s\n"), seed_file_name, strerror(errno) );
- close(fd);
+ _close(fd);
return 0;
}
if (!S_ISREG(sb.st_mode) )
{
log_info(_("`%s' is not a regular file - ignored\n"), seed_file_name );
- close(fd);
+ _close(fd);
return 0;
}
if (!sb.st_size )
{
log_info(_("note: random_seed file is empty\n") );
- close(fd);
+ _close(fd);
allow_seed_file_update = 1;
return 0;
}
if (sb.st_size != POOLSIZE )
{
log_info(_("warning: invalid size of random_seed file - not used\n") );
- close(fd);
+ _close(fd);
return 0;
}
do
{
- n = read( fd, buffer, POOLSIZE );
+ n = _read( fd, buffer, POOLSIZE );
}
while (n == -1 && errno == EINTR );
if (n != POOLSIZE)
{
log_fatal(_("can't read `%s': %s\n"), seed_file_name,strerror(errno) );
- close(fd);/*NOTREACHED*/
+ _close(fd);/*NOTREACHED*/
return 0;
}
- close(fd);
+ _close(fd);
add_randomness( buffer, POOLSIZE, RANDOM_ORIGIN_INIT );
/* add some minor entropy to the pool now (this will also force a mixing) */
@@ -873,7 +873,7 @@ _gcry_rngcsprng_update_seed_file (void) mix_pool(keypool); rndstats.mixkey++;
#if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
- fd = open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
+ fd = _open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
S_IRUSR|S_IWUSR );
#else
# if LOCK_SEED_FILE
@@ -887,7 +887,7 @@ _gcry_rngcsprng_update_seed_file (void) log_info (_("can't create `%s': %s\n"), seed_file_name, strerror(errno) );
else if (lock_seed_file (fd, seed_file_name, 1))
{
- close (fd);
+ _close (fd);
}
#if LOCK_SEED_FILE
else if (ftruncate (fd, 0))
@@ -900,12 +900,12 @@ _gcry_rngcsprng_update_seed_file (void) {
do
{
- i = write (fd, keypool, POOLSIZE );
+ i = _write (fd, keypool, POOLSIZE );
}
while (i == -1 && errno == EINTR);
if (i != POOLSIZE)
log_info (_("can't write `%s': %s\n"),seed_file_name, strerror(errno));
- if (close(fd))
+ if (_close(fd))
log_info (_("can't close `%s': %s\n"),seed_file_name, strerror(errno));
}
diff --git a/libgcrypt-1.4.6/src/gcrypt.h b/libgcrypt-1.4.6/src/gcrypt.h index d583c52..23e9cb3 100644 --- a/libgcrypt-1.4.6/src/gcrypt.h +++ b/libgcrypt-1.4.6/src/gcrypt.h @@ -212,20 +212,20 @@ struct gcry_thread_cbs int (*mutex_destroy) (void **priv); int (*mutex_lock) (void **priv); int (*mutex_unlock) (void **priv); - ssize_t (*read) (int fd, void *buf, size_t nbytes); - ssize_t (*write) (int fd, const void *buf, size_t nbytes); + SSIZE_T (*read) (int fd, void *buf, size_t nbytes); + SSIZE_T (*write) (int fd, const void *buf, size_t nbytes); #ifdef _WIN32 - ssize_t (*select) (int nfd, void *rset, void *wset, void *eset, + SSIZE_T (*select) (int nfd, void *rset, void *wset, void *eset, struct timeval *timeout); - ssize_t (*waitpid) (pid_t pid, int *status, int options); + SSIZE_T (*waitpid) (pid_t pid, int *status, int options); int (*accept) (int s, void *addr, int *length_ptr); int (*connect) (int s, void *addr, gcry_socklen_t length); int (*sendmsg) (int s, const void *msg, int flags); int (*recvmsg) (int s, void *msg, int flags); #else - ssize_t (*select) (int nfd, fd_set *rset, fd_set *wset, fd_set *eset, + SSIZE_T (*select) (int nfd, fd_set *rset, fd_set *wset, fd_set *eset, struct timeval *timeout); - ssize_t (*waitpid) (pid_t pid, int *status, int options); + SSIZE_T (*waitpid) (pid_t pid, int *status, int options); int (*accept) (int s, struct sockaddr *addr, gcry_socklen_t *length_ptr); int (*connect) (int s, struct sockaddr *addr, gcry_socklen_t length); int (*sendmsg) (int s, const struct msghdr *msg, int flags); |
