]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/md5.c
o fix : restore a crypted stream on a fd witch doen't define keys cause
[bacula/bacula] / bacula / src / lib / md5.c
index 0725dc5eaa8b37483d7213857f00eaaadd57e026..4a0867c4be060a55d49f3a83f3bb2edb91770b10 100644 (file)
@@ -298,7 +298,7 @@ int main(int argc, char *argv[])
       exit(1);
    }
 
-   fd = fopen(argv[0], "r");
+   fd = fopen(argv[0], "rb");
    if (!fd) {
       printf("Could not open %s: ERR=%s\n", argv[0], strerror(errno));
       exit(1);
@@ -317,7 +317,7 @@ int main(int argc, char *argv[])
 #ifdef OUTPUT_BASE64
    char MD5buf[40];                 /* 24 should do */ 
    memset(MD5buf, 0, 40);
-   bin_to_base64(MD5buf, (char *)signature, 16); /* encode 16 bytes */
+   bin_to_base64(MD5buf, sizeof(MD5buf), (char *)signature, 16, true); /* encode 16 bytes */
    printf("  %s", MD5buf);
 #endif
    printf("  %s\n", argv[0]);
@@ -347,7 +347,7 @@ decode_it:
       }
       signature[16] = 0;
       printf("%s", buf);
-      bin_to_base64(bin, (char *)signature, 16);
+      bin_to_base64(bin, sizeof(bin), (char *)signature, 16, true);
       printf("%s\n", bin);
    }
 }