Skip to content

Commit

Permalink
more Feed Monitor fixes;GrowlConnector updates
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Nov 6, 2009
1 parent 8c600ca commit 92859b3
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 53 deletions.
Binary file modified Growl Connectors/NET/libraries/Growl.Connector.dll
Binary file not shown.
Binary file modified Growl Connectors/NET/libraries/Growl.CoreLibrary.dll
Binary file not shown.
3 changes: 0 additions & 3 deletions Growl Connectors/NET/libraries/license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.


See below for license information regarding the original Growl (for OSX), other
software libraries used in this project and for the icons used in this software.
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Feed Monitor"
"ProductCode" = "8:{E5CA6A2A-3D51-4E09-AAD9-D47870DB4452}"
"PackageCode" = "8:{8FAFB384-4FC1-4A8D-8319-A0B07EE31F42}"
"ProductCode" = "8:{68CB74CC-4B56-4F28-A218-C20C36C37CBC}"
"PackageCode" = "8:{B00A0528-865B-42F6-9457-13E6FEB49D9E}"
"UpgradeCode" = "8:{E8D784D8-949E-4CC9-BA80-A316D25574D7}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.5"
"ProductVersion" = "8:1.0.6"
"Manufacturer" = "8:element code project"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public FeedInfo Parse(XmlReader reader)
reader.Read();
// some feeds can have duplicate keys, so we don't want to blow up here:
if (!currentItem.ContainsKey(name))
currentItem.Add(name, reader.Value);
currentItem.Add(name, reader.Value.Trim());
}
}
}
Expand Down
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.DisplayStyle.dll
Binary file not shown.
42 changes: 23 additions & 19 deletions Growl/Growl.Connector/ConnectorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public abstract class ConnectorBase
private int port = TCP_PORT;

/// <summary>
/// The algorithm to use when generating hashes
/// The algorithm to use when generating hashes [defaults to MD5]
/// </summary>
private Cryptography.HashAlgorithmType keyHashAlgorithm = Cryptography.HashAlgorithmType.MD5;

/// <summary>
/// The algorithm to use when doing encryption
/// The algorithm to use when doing encryption [defaults to PlainText]
/// </summary>
private Cryptography.SymmetricAlgorithmType encryptionAlgorithm = Cryptography.SymmetricAlgorithmType.AES;
private Cryptography.SymmetricAlgorithmType encryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;

/// <summary>
/// A collection of active ConnectState objects awaiting the EndConnect callback
Expand Down Expand Up @@ -135,7 +135,7 @@ public string Password
/// Gets or sets the algorithm used when hashing values
/// </summary>
/// <value>
/// <see cref="Cryptography.HashAlgorithmType"/>
/// <see cref="Cryptography.HashAlgorithmType"/> - Defaults to <see cref="Cryptography.HashAlgorithmType.MD5"/>
/// </value>
public Cryptography.HashAlgorithmType KeyHashAlgorithm
{
Expand All @@ -153,7 +153,7 @@ public Cryptography.HashAlgorithmType KeyHashAlgorithm
/// Gets or sets the algorithm used when encrypting values
/// </summary>
/// <value>
/// <see cref="Cryptography.SymmetricAlgorithmType"/>
/// <see cref="Cryptography.SymmetricAlgorithmType"/> - Defaults to <see cref="Cryptography.SymmetricAlgorithmType.PlainText"/>
/// </value>
public Cryptography.SymmetricAlgorithmType EncryptionAlgorithm
{
Expand Down Expand Up @@ -220,28 +220,32 @@ protected virtual bool OnBeforeSend(MessageBuilder mb)
protected void Send(MessageBuilder mb, ResponseReceivedEventHandler del, bool waitForCallback)
{
ConnectState state = null;
try

// do some of this *outside* the try...catch so we can just throw an exception if the error occurs
// *before* we even send the request (like when generating the message bytes)
bool doSend = this.OnBeforeSend(mb);
if (doSend)
{
bool doSend = this.OnBeforeSend(mb);
TcpClient client = new TcpClient();
byte[] bytes = mb.GetBytes();
mb = null;

if (doSend)
// anything else that happens will be the result of Growl not being available, so we just want
// to suppress any subsequent exceptions
try
{
TcpClient client = new TcpClient();
byte[] bytes = mb.GetBytes();

mb = null;
AsyncCallback callback = new AsyncCallback(ConnectCallback);
state = new ConnectState(client, bytes, del, waitForCallback);
connecting.Add(state.GUID, state);
client.BeginConnect(this.hostname, this.port, callback, state);
}
}
catch
{
// suppress
// could mean growl is not installed, not running, wrong address, etc
CleanUpSocket(state);
OnCommunicationFailure(new Response(ErrorCode.NETWORK_FAILURE, ErrorDescription.CONNECTION_FAILURE));
catch
{
// suppress
// could mean growl is not installed, not running, wrong address, etc
CleanUpSocket(state);
OnCommunicationFailure(new Response(ErrorCode.NETWORK_FAILURE, ErrorDescription.CONNECTION_FAILURE));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions Growl/Growl.Connector/Growl.Connector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Mono|AnyCPU' ">
<OutputPath>bin\Mono\</OutputPath>
Expand Down
5 changes: 1 addition & 4 deletions Growl/Growl.Connector/Key.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ protected Key(string password, Cryptography.HashAlgorithmType hashAlgorithm, Cry
this.hashAlgorithm = hashAlgorithm;
this.encryptionAlgorithm = encryptionAlgorithm;

// byte[] saltBytes = Cryptography.GenerateBytes(8);
// this.salt = Cryptography.HexEncode(saltBytes);

byte[] saltBytes = Growl.Connector.Cryptography.HexUnencode("bbdf0d5db70ab6f0bf6a18b804a4c3c0");
byte[] saltBytes = Cryptography.GenerateBytes(8);
this.salt = Cryptography.HexEncode(saltBytes);

byte[] passwordBytes = System.Text.Encoding.UTF8.GetBytes(password);
Expand Down
4 changes: 0 additions & 4 deletions Growl/Growl.Connector/MessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public override byte[] GetBytes()
// encrypt message
byte[] bytesToEncrypt = messageBytes.ToArray();
EncryptionResult result = key.Encrypt(bytesToEncrypt);
//EncryptionResult result = Cryptography.Encrypt(encryptionKey, bytesToEncrypt, this.encryptionAlgorithm);

string encryptionInfo = DisplayName.Fetch(key.EncryptionAlgorithm);
if (key.EncryptionAlgorithm != Cryptography.SymmetricAlgorithmType.PlainText)
Expand All @@ -131,8 +130,6 @@ public override byte[] GetBytes()
string hashInfo = "";
if (includeKeyHash)
{
//string keyHash = Cryptography.HexEncode(Cryptography.ComputeHash(key, keyHashAlgorithm));
//string keyHash = key.GetKeyHash(this.keyHashAlgorithm);
string keyHash = key.KeyHash;
string salt = key.Salt;
hashInfo = String.Format("{0}:{1}.{2}", DisplayName.Fetch(key.HashAlgorithm), keyHash, salt);
Expand All @@ -152,7 +149,6 @@ public override byte[] GetBytes()
if (data != null && data.Data != null)
{
// encrypt each resource, making sure to use the same IV
//EncryptionResult er = Cryptography.Encrypt(encryptionKey, data.Data, this.encryptionAlgorithm, ref result.IV);
EncryptionResult er = key.Encrypt(data.Data, ref result.IV);

MessageSection section = new MessageSection();
Expand Down
1 change: 1 addition & 0 deletions Growl/Growl.CoreLibrary/Growl.CoreLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Mono|AnyCPU' ">
<OutputPath>bin\Mono\</OutputPath>
Expand Down
32 changes: 16 additions & 16 deletions Growl/Growl.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.Daemon", "Growl.Daemon\Growl.Daemon.csproj", "{6112CD52-1F16-4068-8D16-CB9C5467E8C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test Server", "Test Server\Test Server.csproj", "{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl", "Growl\Growl.csproj", "{D4FAD0E4-FD93-4379-8684-F3288F06A588}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.UDPLegacy", "Growl.UDPLegacy\Growl.UDPLegacy.csproj", "{901C016A-9008-4190-A067-E578E7E66B1A}"
Expand Down Expand Up @@ -37,25 +33,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.Localization.nb-NO",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.Connector", "Growl.Connector\Growl.Connector.csproj", "{19C22138-B905-47BA-9E6E-EF9356907E53}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test App", "Test App\Test App.csproj", "{453F9C34-68B5-45A4-B34B-96607C6A4680}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test Server", "Test Server\Test Server.csproj", "{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Mono|Any CPU = Mono|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Mono|Any CPU.Build.0 = Mono|Any CPU
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6112CD52-1F16-4068-8D16-CB9C5467E8C3}.Release|Any CPU.Build.0 = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Mono|Any CPU.Build.0 = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Release|Any CPU.Build.0 = Release|Any CPU
{D4FAD0E4-FD93-4379-8684-F3288F06A588}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4FAD0E4-FD93-4379-8684-F3288F06A588}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4FAD0E4-FD93-4379-8684-F3288F06A588}.Mono|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -150,6 +138,18 @@ Global
{19C22138-B905-47BA-9E6E-EF9356907E53}.Mono|Any CPU.Build.0 = Mono|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Release|Any CPU.Build.0 = Release|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Debug|Any CPU.Build.0 = Debug|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Mono|Any CPU.Build.0 = Release|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Release|Any CPU.ActiveCfg = Release|Any CPU
{453F9C34-68B5-45A4-B34B-96607C6A4680}.Release|Any CPU.Build.0 = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Mono|Any CPU.Build.0 = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25D4D0A4-22D0-4E87-A8D6-A58AA592D28C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 9 additions & 2 deletions Growl/Test App/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,15 @@ private void button1_Click(object sender, EventArgs e)
//rd.Add("Return-To-Me2", "another value");
Growl.Connector.RequestData rd = null;

growl.Register(this.app, types, rd);
this.textBox1.Text = "REGISTER sent";
try
{
growl.Register(this.app, types, rd);
this.textBox1.Text = "REGISTER sent";
}
catch (Exception ex)
{
this.textBox1.Text = ex.Message;
}
}

private void button2_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 92859b3

Please sign in to comment.