Restore deleted triggers
[platform/core/multimedia/libmedia-service.git] / md5 / media-svc-hash.c
index affe10b..77df888 100755 (executable)
@@ -60,9 +60,8 @@ char *_mb_svc_generate_hash_name(const char *file)
        const unsigned char *c;
        int length;
 
-       if (!file) {
+       if (!file)
                return NULL;
-       }
 
        length = 3 * strlen(file) + 9;
 
@@ -72,9 +71,8 @@ char *_mb_svc_generate_hash_name(const char *file)
        ((c) >= 32 && (c) < 128 && (ACCEPTABLE_URI_CHARS[(c) - 32] & 0x08))
 
        uri = alloca(length);
-       if (uri == NULL) {
+       if (uri == NULL)
                return NULL;
-       }
 
        strncpy(uri, "file://", length);
        uri[length - 1] = '\0';
@@ -92,9 +90,9 @@ char *_mb_svc_generate_hash_name(const char *file)
        *t = '\0';
 #undef _check_uri_char
 
-       MD5Init(&ctx);
-       MD5Update(&ctx, (unsigned char const *)uri, (unsigned)strlen(uri));
-       MD5Final(hash, &ctx);
+       media_svc_MD5Init(&ctx);
+       media_svc_MD5Update(&ctx, (unsigned char const *)uri, (unsigned)strlen(uri));
+       media_svc_MD5Final(hash, &ctx);
 
        for (n = 0; n < MD5_HASHBYTES; n++) {
                md5out[2 * n] = hex[hash[n] >> 4];
@@ -109,15 +107,13 @@ int mb_svc_generate_hash_code(const char *origin_path, char *hash_code, int max_
 {
        char *hash = NULL;
 
-       if (max_length < ((2 * MD5_HASHBYTES) + 1)) {
+       if (max_length < ((2 * MD5_HASHBYTES) + 1))
                return MS_MEDIA_ERR_INVALID_PARAMETER;
-       }
 
        hash = _mb_svc_generate_hash_name(origin_path);
 
-       if (hash == NULL) {
+       if (hash == NULL)
                return MS_MEDIA_ERR_INTERNAL;
-       }
 
        strncpy(hash_code, hash, max_length);
        hash_code[strlen(hash_code)] = '\0';