[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. f5edd3e88aa2138dcf6d044c835fbd0ada944168

Sven Nierlein sven at nierlein.org
Fri Feb 11 11:18:15 UTC 2011


The following commit has been merged in the master branch:
commit b6e36a01b944f0151392f98859d1af7b0ab22294
Author: Sven Nierlein <sven at nierlein.org>
Date:   Sun Jan 30 23:54:29 2011 +0100

    use null byte to fill up encrypted text

diff --git a/common/crypt.c b/common/crypt.c
index 041d597..0b51220 100644
--- a/common/crypt.c
+++ b/common/crypt.c
@@ -74,7 +74,7 @@ int mod_gm_aes_encrypt(unsigned char ** encrypted, char * text) {
         }
 
         for (; j < BLOCKSIZE; j++)
-            plaintext[j] = '\n';
+            plaintext[j] = '\x0';
         rijndaelEncrypt(rk, nrounds, plaintext, ciphertext);
         for (j = 0; j < BLOCKSIZE; j++)
             enc[k++] = ciphertext[j];
diff --git a/t/01-utils.c b/t/01-utils.c
index 3b4076c..c83f27e 100644
--- a/t/01-utils.c
+++ b/t/01-utils.c
@@ -41,20 +41,22 @@ int main(void) {
 
 
     /* encrypt */
-    char * key = "test1234";
+    char * key       = "test1234";
     char * encrypted = malloc(GM_BUFFERSIZE);
-    char * text = "test message";
+    char * text      = "test message";
+    char * base      = "a7HqhQEE8TQBde9uknpPYQ==";
     mod_gm_crypt_init(key);
     int len;
     len = mod_gm_encrypt(&encrypted, text, GM_ENCODE_AND_ENCRYPT);
     ok(len == 24, "length of encrypted only");
-    ok(!strcmp(encrypted, "2atT3F70gNGcggA0dHVTRA=="), "encrypted string");
+    if(!ok(!strcmp(encrypted, base), "encrypted string"))
+        diag("expected: '%s' but got: '%s'", base, encrypted);
 
     /* decrypt */
     char * decrypted = malloc(GM_BUFFERSIZE);
     mod_gm_decrypt(&decrypted, encrypted, GM_ENCODE_AND_ENCRYPT);
-    if(!ok(!strcmp(trim(decrypted), text), "decrypted text"))
-        diag("expected: '%s' but got: '%s'", text, trim(decrypted));
+    if(!ok(!strcmp(decrypted, text), "decrypted text"))
+        diag("expected: '%s' but got: '%s'", text, decrypted);
     free(decrypted);
     free(encrypted);
 

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list