mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/Ghidra_12.2'
This commit is contained in:
@@ -417,6 +417,10 @@ public class BundleHost {
|
||||
// setup the cache path
|
||||
config.setProperty(Constants.FRAMEWORK_STORAGE, makeCacheDir());
|
||||
|
||||
// prevent the use of Felix URL handlers which can interfere with URL.openConnection
|
||||
// exception handling
|
||||
config.put(FelixConstants.SERVICE_URLHANDLERS_PROP, "false");
|
||||
|
||||
config.put(FelixConstants.LOG_LEVEL_PROP, "1");
|
||||
if (STDERR_DEBUGGING) {
|
||||
config.put(FelixConstants.LOG_LEVEL_PROP, "999");
|
||||
|
||||
@@ -36,7 +36,14 @@ import ghidra.util.Msg;
|
||||
*/
|
||||
public class ProgramLocator {
|
||||
private final DomainFile domainFile;
|
||||
|
||||
// Connections and any saved state should be based upon a non-normalized URL
|
||||
// as it was originally specified. This is necessary to ensure that server
|
||||
// certificate validation is based upon the original server hostname as
|
||||
// specified by the user.
|
||||
private final URL ghidraURL;
|
||||
private final URL normalizedGhidraURL;
|
||||
|
||||
private final int version;
|
||||
private final boolean invalidContent;
|
||||
|
||||
@@ -49,7 +56,8 @@ public class ProgramLocator {
|
||||
if (!GhidraURL.isGhidraURL(url)) {
|
||||
throw new IllegalArgumentException("unsupported protocol: " + url.getProtocol());
|
||||
}
|
||||
this.ghidraURL = GhidraURL.getNormalizedURL(url);
|
||||
this.ghidraURL = url;
|
||||
this.normalizedGhidraURL = GhidraURL.getNormalizedURL(url);
|
||||
this.domainFile = null;
|
||||
this.version = DomainFile.DEFAULT_VERSION;
|
||||
this.invalidContent = false; // unable to validate
|
||||
@@ -98,6 +106,7 @@ public class ProgramLocator {
|
||||
}
|
||||
this.domainFile = file;
|
||||
this.ghidraURL = url;
|
||||
this.normalizedGhidraURL = url != null ? GhidraURL.getNormalizedURL(url) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,13 +118,22 @@ public class ProgramLocator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL for this locator or null if this is a DomainFile based locator
|
||||
* @return the URL for this locator or null if this is a DomainFile based locator
|
||||
* Returns the Ghidra URL for this locator or null if this is a DomainFile based locator.
|
||||
* This URL represents the original URL form when locator was first instantiated.
|
||||
* @return the Ghidra URL for this locator or null if this is a DomainFile based locator.
|
||||
*/
|
||||
public URL getURL() {
|
||||
return ghidraURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the normalized Ghidra URL for this locator or null if this is a DomainFile based locator.
|
||||
* @return the Ghidra URL for this locator or null if this is a DomainFile based locator.
|
||||
*/
|
||||
public URL getNormalizedURL() {
|
||||
return normalizedGhidraURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version of the program that this locator represents
|
||||
* @return the version of the program that this locator represents
|
||||
@@ -166,7 +184,7 @@ public class ProgramLocator {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(domainFile, ghidraURL, version);
|
||||
return Objects.hash(domainFile, normalizedGhidraURL, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,7 +200,8 @@ public class ProgramLocator {
|
||||
}
|
||||
ProgramLocator other = (ProgramLocator) obj;
|
||||
return Objects.equals(domainFile, other.domainFile) &&
|
||||
Objects.equals(ghidraURL, other.ghidraURL) && version == other.version;
|
||||
Objects.equals(normalizedGhidraURL, other.normalizedGhidraURL) &&
|
||||
version == other.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user