diff options
author | Linus Walleij <triad@df.lth.se> | 2012-09-29 13:29:55 +0200 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2012-09-29 13:29:55 +0200 |
commit | f03e7e85f21de457a941773692c782f6bdef6448 (patch) | |
tree | a725e60ddba96bee8563af3d999aa8a42aa13bae | |
parent | ed6fdca9a3c39d0d75831e6e5a997ec7e5ecc36a (diff) | |
download | libmtp-f03e7e85f21de457a941773692c782f6bdef6448.tar.gz |
Fix to some MTPZ error messages
Signed-off-by: Linus Walleij <triad@df.lth.se>
-rw-r--r-- | src/mtpz.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -117,7 +117,7 @@ int mtpz_loaddata() char *home = getenv("HOME"); if (!home) { - LIBMTP_INFO("Error: Unable to determine user's home directory.\n"); + LIBMTP_INFO("Unable to determine user's home directory, MTPZ disabled"); return -1; } @@ -128,7 +128,7 @@ int mtpz_loaddata() FILE *fdata = fopen(path, "r"); if (!fdata) { - LIBMTP_INFO("Error: Unable to open ~/.mtpz-data for reading.\n"); + LIBMTP_INFO("Unable to open ~/.mtpz-data for reading, MTPZ disabled."); return -1; } @@ -136,7 +136,7 @@ int mtpz_loaddata() MTPZ_PUBLIC_EXPONENT = (unsigned char *)fgets_strip((char *)malloc(8), 8, fdata); if (!MTPZ_PUBLIC_EXPONENT) { - LIBMTP_INFO("Error: Unable to read MTPZ public exponent from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ public exponent from ~/.mtpz-data, MTPZ disabled"); return -1; } @@ -144,20 +144,20 @@ int mtpz_loaddata() char *hexenckey = (unsigned char *)fgets_strip((char *)malloc(35), 35, fdata); if (!hexenckey) { - LIBMTP_INFO("Error: Unable to read MTPZ encryption key from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ encryption key from ~/.mtpz-data, MTPZ disabled"); return -1; } MTPZ_ENCRYPTION_KEY = hex_to_bytes(hexenckey, strlen(hexenckey)); if (!MTPZ_ENCRYPTION_KEY) { - LIBMTP_INFO("Error: Unable to read MTPZ encryption key from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ encryption key from ~/.mtpz-data, MTPZ disabled"); } // Should only be 256 characters in length, but fgets will encounter a newline and stop. MTPZ_MODULUS = (unsigned char *)fgets_strip((char *)malloc(260), 260, fdata); if (!MTPZ_MODULUS) { - LIBMTP_INFO("Error: Unable to read MTPZ modulus from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ modulus from ~/.mtpz-data, MTPZ disabled"); return -1; } @@ -165,7 +165,7 @@ int mtpz_loaddata() MTPZ_PRIVATE_KEY = (unsigned char *)fgets_strip((char *)malloc(260), 260, fdata); if (!MTPZ_PRIVATE_KEY) { - LIBMTP_INFO("Error: Unable to read MTPZ private key from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ private key from ~/.mtpz-data, MTPZ disabled"); return -1; } @@ -173,13 +173,13 @@ int mtpz_loaddata() char *hexcerts = fgets_strip((char *)malloc(1260), 1260, fdata); if (!hexcerts) { - LIBMTP_INFO("Error: Unable to read MTPZ certificates from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to read MTPZ certificates from ~/.mtpz-data, MTPZ disabled"); return -1; } MTPZ_CERTIFICATES = hex_to_bytes(hexcerts, strlen(hexcerts)); if (!MTPZ_CERTIFICATES) { - LIBMTP_INFO("Error: Unable to parse MTPZ certificates from ~/.mtpz-data\n"); + LIBMTP_INFO("Unable to parse MTPZ certificates from ~/.mtpz-data, MTPZ disabled"); return -1; } |