Skip to content
Snippets Groups Projects
Commit 0f19d66b authored by anthony lawrence's avatar anthony lawrence
Browse files
parents dcdf33b9 207f729a
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,7 @@
</javac>
</target>
<target name="dist" depends="jni,init-ivy"
<target name="dist" depends="init-ivy, compile"
description="generate the distribution" >
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/Tsk_DataModel.jar" basedir="${build}"/>
......
......@@ -15,8 +15,8 @@
#include <locale.h>
#include <time.h>
TSK_HDB_INFO * m_NSRLDb;
TSK_HDB_INFO * m_knownBadDb;
static TSK_HDB_INFO * m_NSRLDb = NULL;
static TSK_HDB_INFO * m_knownBadDb = NULL;
/** Throw an TSK exception back up to the Java code with a specific message.
*/
......@@ -251,18 +251,18 @@ JNIEXPORT void JNICALL
*/
JNIEXPORT jint JNICALL Java_org_sleuthkit_datamodel_SleuthkitJNI_hashDBLookup
(JNIEnv * env, jclass obj, jstring hash){
jboolean isCopy;
const char *md5 = (const char *) env->GetStringUTFChars(hash, &isCopy);
TSK_AUTO_CASE_KNOWN_FILE_ENUM file_known = TSK_AUTO_CASE_FILE_KNOWN_UNKNOWN;
if (m_NSRLDb != NULL) {
int8_t retval = tsk_hdb_lookup_str(m_NSRLDb, md5, TSK_HDB_FLAG_QUICK, NULL, NULL);
if (retval == -1) {
throwTskError(env, "error matching nsrl hashset");
throwTskError(env);
} else if (retval) {
file_known = TSK_AUTO_CASE_FILE_KNOWN_KNOWN;
}
......@@ -270,15 +270,15 @@ JNIEXPORT jint JNICALL Java_org_sleuthkit_datamodel_SleuthkitJNI_hashDBLookup
if (m_knownBadDb != NULL) {
int8_t retval = tsk_hdb_lookup_str(m_knownBadDb, md5, TSK_HDB_FLAG_QUICK, NULL, NULL);
if (retval == -1) {
throwTskError(env, "error matching known bad hashset");
throwTskError(env);
} else if (retval) {
file_known = TSK_AUTO_CASE_FILE_KNOWN_BAD;
}
}
env->ReleaseStringUTFChars(hash, (const char *) md5);
env->ReleaseStringUTFChars(hash, (const char *) md5);
return (int) file_known;
}
......
......@@ -32,9 +32,9 @@ class Hash {
/**
* generate the md5 hash for the given content
*
* @param content Content object whose md5 hash we want to calculate
* @return md5 of the given Content object
*
* @param content Content object whose md5 hash we want to calculate
* @return md5 of the given Content object
*/
static String calculateMd5(Content content) {
String hashText = "";
......@@ -56,9 +56,11 @@ static String calculateMd5(Content content) {
hashText = "0" + hashText;
}
} catch (NoSuchAlgorithmException ex) {
logger.log(Level.SEVERE, "No algorithm known as 'md5'", ex);
// TODO This should be higher than INFO, but we want to avoid pop-ups during ingest. Find better fix in future.
logger.log(Level.INFO, "No algorithm known as 'md5'", ex);
} catch (IOException ex) {
logger.log(Level.SEVERE, "Error reading content", ex);
// TODO This should be higher than INFO, but we want to avoid pop-ups during ingest. Find better fix in future.
logger.log(Level.INFO, "Error reading content", ex);
}
return hashText;
}
......
......@@ -1491,9 +1491,11 @@ public String lookupFileMd5(Content cont) throws TskException{
updateHashAndKnown(contId, md5Hash, fileKnown);
return fileKnown.getName();
} catch (TskException ex) {
logger.log(Level.SEVERE, "Error looking up known status", ex);
// TODO This should be higher than INFO, but we want to avoid pop-ups during ingest. Find better fix in future.
logger.log(Level.INFO, "Error looking up known status", ex);
} catch(SQLException ex) {
logger.log(Level.SEVERE, "Error updating SQL database", ex);
// TODO This should be higher than INFO, but we want to avoid pop-ups during ingest. Find better fix in future.
logger.log(Level.INFO, "Error updating SQL database", ex);
}
throw new TskException("Error analyzing file");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment