X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fcrypto.c;h=df0af666b0eef3c5a25d872fd0fee81b5a8df59c;hb=0a6dbd76f58caad61a494a64e9bd421de61f6aa6;hp=8aeba3aebc2e7c4ae124959033442bea1962ddc1;hpb=da3686c428dbcfdc010f88001325668f0e09bd8b;p=bluesky.git diff --git a/bluesky/crypto.c b/bluesky/crypto.c index 8aeba3a..df0af66 100644 --- a/bluesky/crypto.c +++ b/bluesky/crypto.c @@ -15,6 +15,8 @@ #include "bluesky.h" +static int DISABLE_CRYPTO = 1; + /* Cryptographic operations. The rest of the BlueSky code merely calls into * the functions in this file, so this is the only point where we interface * with an external cryptographic library. */ @@ -46,6 +48,11 @@ void bluesky_crypt_random_bytes(guchar *buf, gint len) /* Encrypt a data block. */ BlueSkyRCStr *bluesky_crypt_encrypt(BlueSkyRCStr *in, const uint8_t *key) { + if (DISABLE_CRYPTO) { + bluesky_string_ref(in); + return in; + } + gcry_error_t status; gcry_cipher_hd_t handle; @@ -86,6 +93,11 @@ BlueSkyRCStr *bluesky_crypt_encrypt(BlueSkyRCStr *in, const uint8_t *key) /* Decrypt a data block. */ BlueSkyRCStr *bluesky_crypt_decrypt(BlueSkyRCStr *in, const uint8_t *key) { + if (DISABLE_CRYPTO) { + bluesky_string_ref(in); + return in; + } + gcry_error_t status; gcry_cipher_hd_t handle;