projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add new standards subfile
[gnulib.git]
/
lib
/
gc-libgcrypt.c
diff --git
a/lib/gc-libgcrypt.c
b/lib/gc-libgcrypt.c
index
6649660
..
2affba0
100644
(file)
--- a/
lib/gc-libgcrypt.c
+++ b/
lib/gc-libgcrypt.c
@@
-1,5
+1,5
@@
/* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC.
/* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC.
- * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
, 2008
Simon Josefsson
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
@@
-46,6
+46,9
@@
gc_init (void)
err = gcry_control (GCRYCTL_ANY_INITIALIZATION_P);
if (err == GPG_ERR_NO_ERROR)
{
err = gcry_control (GCRYCTL_ANY_INITIALIZATION_P);
if (err == GPG_ERR_NO_ERROR)
{
+ if (gcry_control (GCRYCTL_DISABLE_SECMEM, NULL, 0))
+ return GC_INIT_ERROR;
+
if (gcry_check_version (GCRYPT_VERSION) == NULL)
return GC_INIT_ERROR;
if (gcry_check_version (GCRYPT_VERSION) == NULL)
return GC_INIT_ERROR;
@@
-142,6
+145,16
@@
gc_cipher_open (Gc_cipher alg, Gc_cipher_mode mode,
gcryalg = GCRY_CIPHER_RFC2268_40;
break;
gcryalg = GCRY_CIPHER_RFC2268_40;
break;
+#ifdef HAVE_CAMELLIA
+ case GC_CAMELLIA128:
+ gcryalg = GCRY_CIPHER_CAMELLIA128;
+ break;
+
+ case GC_CAMELLIA256:
+ gcryalg = GCRY_CIPHER_CAMELLIA256;
+ break;
+#endif
+
default:
return GC_INVALID_CIPHER;
}
default:
return GC_INVALID_CIPHER;
}
@@
-240,7
+253,7
@@
Gc_rc
gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
{
_gc_hash_ctx *ctx;
gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
{
_gc_hash_ctx *ctx;
- int gcryalg
, gcrymode
;
+ int gcryalg
= 0, gcrymode = 0
;
gcry_error_t err;
Gc_rc rc = GC_OK;
gcry_error_t err;
Gc_rc rc = GC_OK;
@@
-281,6
+294,10
@@
gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
gcryalg = GCRY_MD_SHA512;
break;
gcryalg = GCRY_MD_SHA512;
break;
+ case GC_SHA224:
+ gcryalg = GCRY_MD_SHA224;
+ break;
+
case GC_RMD160:
gcryalg = GCRY_MD_RMD160;
break;
case GC_RMD160:
gcryalg = GCRY_MD_RMD160;
break;
@@
-380,6
+397,10
@@
gc_hash_digest_length (Gc_hash hash)
len = GC_SHA512_DIGEST_SIZE;
break;
len = GC_SHA512_DIGEST_SIZE;
break;
+ case GC_SHA224:
+ len = GC_SHA224_DIGEST_SIZE;
+ break;
+
default:
return 0;
}
default:
return 0;
}
@@
-495,6
+516,12
@@
gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *resbuf)
break;
#endif
break;
#endif
+#ifdef GNULIB_GC_SHA224
+ case GC_SHA224:
+ gcryalg = GCRY_MD_SHA224;
+ break;
+#endif
+
#ifdef GNULIB_GC_RMD160
case GC_RMD160:
gcryalg = GCRY_MD_RMD160;
#ifdef GNULIB_GC_RMD160
case GC_RMD160:
gcryalg = GCRY_MD_RMD160;