summaryrefslogtreecommitdiff
path: root/src/skey/md5.c
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-06 19:14:03 -0300
committerPerberos <[email protected]>2011-11-06 19:14:03 -0300
commitf2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e (patch)
tree5bc248a29ae93e5534428e6908a94d50d419ceb9 /src/skey/md5.c
parentdef492f92d29f294c62d94ef562dd6271bd9b84b (diff)
downloadmate-terminal-f2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e.tar.bz2
mate-terminal-f2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e.tar.xz
aplicando formato allman
Diffstat (limited to 'src/skey/md5.c')
-rw-r--r--src/skey/md5.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/skey/md5.c b/src/skey/md5.c
index 9447c15..de9d7a7 100644
--- a/src/skey/md5.c
+++ b/src/skey/md5.c
@@ -12,9 +12,9 @@ int MD5Keycrunch(char *result, const char *seed, const char *passhrase)
{
char *buf;
gsize len;
- GChecksum *checksum;
- guint8 digest[16];
- gsize digest_len = sizeof (digest);
+ GChecksum *checksum;
+ guint8 digest[16];
+ gsize digest_len = sizeof (digest);
guint32 *results;
len = strlen(seed) + strlen(passhrase);
@@ -27,41 +27,41 @@ int MD5Keycrunch(char *result, const char *seed, const char *passhrase)
strcat(buf, passhrase);
skey_sevenbit(buf);
- checksum = g_checksum_new (G_CHECKSUM_MD5);
- g_checksum_update (checksum, (const guchar *) buf, len);
+ checksum = g_checksum_new (G_CHECKSUM_MD5);
+ g_checksum_update (checksum, (const guchar *) buf, len);
g_free(buf);
- g_checksum_get_digest (checksum, digest, &digest_len);
- g_assert (digest_len == 16);
+ g_checksum_get_digest (checksum, digest, &digest_len);
+ g_assert (digest_len == 16);
- results = (guint32 *) digest;
+ results = (guint32 *) digest;
results[0] ^= results[2];
results[1] ^= results[3];
memcpy((void *)result, (void *)results, SKEY_SIZE);
- g_checksum_free (checksum);
+ g_checksum_free (checksum);
return 0;
}
void MD5SKey(char *x)
{
- GChecksum *checksum;
- guint8 digest[16];
- gsize digest_len = sizeof (digest);
+ GChecksum *checksum;
+ guint8 digest[16];
+ gsize digest_len = sizeof (digest);
guint32 *results;
- checksum = g_checksum_new (G_CHECKSUM_MD5);
- g_checksum_update (checksum, (const guchar *) x, SKEY_SIZE);
- g_checksum_get_digest (checksum, digest, &digest_len);
- g_assert (digest_len == 16);
+ checksum = g_checksum_new (G_CHECKSUM_MD5);
+ g_checksum_update (checksum, (const guchar *) x, SKEY_SIZE);
+ g_checksum_get_digest (checksum, digest, &digest_len);
+ g_assert (digest_len == 16);
- results = (guint32 *) digest;
+ results = (guint32 *) digest;
results[0] ^= results[2];
results[1] ^= results[3];
memcpy((void *)x, (void *)results, SKEY_SIZE);
- g_checksum_free (checksum);
+ g_checksum_free (checksum);
}