Skip to content

Commit 241e73e

Browse files
author
Noah Potash
committed
Updated to rc2, retargeted to netstandard1.3, implemented ci, added badges.
1 parent 7c5cacd commit 241e73e

14 files changed

+152
-81
lines changed

Diff for: .travis.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# Configuration taken and modified from https://github.com/maxmind/MaxMind-DB-Reader-dotnet/blob/master/.travis.yml
3+
sudo: false
4+
language: csharp
5+
# dotnet cli requires Ubuntu 14.04
6+
sudo: required
7+
dist: trusty
8+
9+
# dotnet cli requires OSX 10.10
10+
osx_image: xcode7.1
11+
12+
addons:
13+
apt:
14+
packages:
15+
- libunwind8
16+
17+
os:
18+
- osx
19+
- linux
20+
21+
env:
22+
matrix:
23+
- CLI_VERSION: Latest
24+
Configuration: Debug
25+
Framework: netcoreapp1.0
26+
- CLI_VERSION: Latest
27+
Configuration: Release
28+
Framework: netcoreapp1.0
29+
30+
before_install:
31+
# Download script to install dotnet cli
32+
- curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ~/dotnet
33+
34+
- export DOTNET_INSTALL_DIR="~/dotnet"
35+
36+
# Add dotnet to PATH
37+
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
38+
39+
install:
40+
- git submodule update --init --recursive
41+
- which dotnet;
42+
if [ $? -eq 0 ]; then
43+
echo "Using dotnet:";
44+
dotnet --info;
45+
else
46+
echo "dotnet.exe not found"
47+
exit 1;
48+
fi
49+
50+
# Restore dependencies
51+
- dotnet restore
52+
53+
- FrameworkLibsMoniker="netstandard1.3"
54+
55+
# Build projects
56+
- dotnet build -c $Configuration -f $FrameworkLibsMoniker ./src/LibPacketGremlin
57+
58+
script:
59+
- cd test/LibPacketGremlinTests
60+
- dotnet test

Diff for: LibPacketGremlin.sln

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
4+
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{61C6CCBC-2613-4FF6-93B0-533746A87808}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{85C76C2E-90E5-4E11-A66F-85766B027EBE}"
99
ProjectSection(SolutionItems) = preProject
1010
global.json = global.json
11+
NuGet.Config = NuGet.Config
1112
README.md = README.md
1213
EndProjectSection
1314
EndProject

Diff for: NuGet.Config

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
5+
<add key="XUnit" value="https://www.myget.org/F/xunit/" />
6+
<add key="xunit-runner-prototype" value="https://www.myget.org/F/coreclr-xunit/api/v2" />
7+
<add key="CI Builds (dotnet-cli)" value="https://www.myget.org/F/dotnet-cli/" />
8+
<add key="ASP.NET Release" value="https://www.myget.org/F/aspnetrelease/" />
9+
</packageSources>
10+
</configuration>

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# LibPacketGremlin ![LibPacketGremlin](https://raw.githubusercontent.com/SapientGuardian/LibPacketGremlin/master/resources/GremlinBig.png)
2+
3+
[![Windows Build status](https://ci.appveyor.com/api/projects/status/qyts6uw1t19m3wck?svg=true)](https://ci.appveyor.com/project/SapientGuardian/LibPacketGremlin)<br />
4+
[![Linux/OSX Build Status](https://travis-ci.org/SapientGuardian/LibPacketGremlin.png)](https://travis-ci.org/SapientGuardian/LibPacketGremlin)<br />
5+
[![NuGet Package](https://img.shields.io/nuget/vpre/LibPacketGremlin.svg)](https://www.nuget.org/packages/LibPacketGremlin/)
6+
27
## Description
38
LibPacketGremlin is a library for manipulating packets on the .NET platform
49

Diff for: appveyor.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 1.0.0-rc2-{build}
2+
image: Visual Studio 2015
3+
build_script:
4+
- cmd: >-
5+
dotnet restore -v Warning
6+
7+
dotnet pack .\src\LibPacketGremlin -o .\artifacts\LibPacketGremlin -c Release
8+
test_script:
9+
- cmd: >-
10+
cd test\LibPacketGremlinTests
11+
12+
dotnet test
13+
artifacts:
14+
- path: 'artifacts\**\*.nupkg'
15+
deploy:
16+
provider: NuGet
17+
api_key:
18+
secure: 7nX5a7V6wWbtPSJ6bQSU9BRZwJEdn70w0Ydlf5fuk44Gjk9BVgxnYK6u8MNzT2yA
19+
artifact: /.*\.nupkg/
20+
on:
21+
branch: master
22+
appveyor_repo_tag: true

Diff for: global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "test" ],
33
"sdk": {
4-
"version": "1.0.0-rc1-update1"
4+
"version": "1.0.0-preview1-002702"
55
}
66
}

Diff for: src/LibPacketGremlin/LibPacketGremlin.xproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ProjectGuid>eb4c9272-709a-421d-931a-4ba74086a8a7</ProjectGuid>
1010
<RootNamespace>OutbreakLabs.LibPacketGremlin</RootNamespace>
1111
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>

Diff for: src/LibPacketGremlin/Properties/AssemblyInfo.cs

-31
This file was deleted.

Diff for: src/LibPacketGremlin/Utilities/Crc32Algorithm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected override void HashCore(byte[] buffer, int start, int length)
126126
protected override byte[] HashFinal()
127127
{
128128
var hashBuffer = UintToBigEndianBytes(~this._hash);
129-
#if !DOTNET5_4
129+
#if !NETSTANDARD1_3
130130
this.HashValue = hashBuffer;
131131
#endif
132132
return hashBuffer;

Diff for: src/LibPacketGremlin/Utilities/IEEE802_11Crypto.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,10 @@ public static byte[] CalculatePMK(byte[] psk, byte[] ssid, int pmk_len = 32)
254254
{
255255
var pbkdf2 = new Rfc2898DeriveBytes(psk, /*ssid*/new byte[8], 4096);
256256
// This reflection crap is required because there's an arbitrary restriction that the salt must be at least 8 bytes
257-
var saltProp = pbkdf2.GetType().GetField("m_salt", BindingFlags.NonPublic | BindingFlags.Instance);
257+
var oldSaltProp = pbkdf2.GetType().GetField("m_salt", BindingFlags.NonPublic | BindingFlags.Instance);
258+
var newSaltProp = pbkdf2.GetType().GetField("_salt", BindingFlags.NonPublic | BindingFlags.Instance);
258259

259-
saltProp.SetValue(pbkdf2, ssid);
260+
(oldSaltProp ?? newSaltProp).SetValue(pbkdf2, ssid);
260261

261262
// pbkdf2.Reset(); //To officially complete the reflection trick, the private method Initialize() should be called. That's all Reset() does.
262263
// But I don't think it's needed because we haven't hashed anything yet.

Diff for: src/LibPacketGremlin/project.json

+24-21
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
{
2-
"version": "1.0.0-beta-4",
2+
"version": "1.0.0-rc2-001",
33
"description": "Library for manipulating packets",
44
"authors": [ "Noah Potash" ],
5-
"tags": [ "packet", "packets" ],
6-
"projectUrl": "https://github.com/SapientGuardian/LibPacketGremlin",
7-
"licenseUrl": "http://opensource.org/licenses/MIT",
8-
"iconUrl": "https://raw.githubusercontent.com/SapientGuardian/LibPacketGremlin/master/resources/Gremlin64x64.png",
5+
"buildOptions": {
6+
"emitEntryPoint": false
7+
},
8+
"packOptions": {
9+
"tags": [ "packet", "packets" ],
10+
"projectUrl": "https://github.com/SapientGuardian/LibPacketGremlin",
11+
"licenseUrl": "http://opensource.org/licenses/MIT",
12+
"iconUrl": "https://raw.githubusercontent.com/SapientGuardian/LibPacketGremlin/master/resources/Gremlin64x64.png"
13+
},
914
"copyright": "Copyright © 2016 Outbreak Labs",
15+
"dependencies": {
16+
"Microsoft.CSharp": "4.0.1-rc2-24027",
17+
"System.Collections": "4.0.11-rc2-24027",
18+
"System.Linq": "4.1.0-rc2-24027",
19+
"System.Runtime": "4.1.0-rc2-24027",
20+
"System.Threading": "4.0.11-rc2-24027",
21+
"System.Collections.Specialized": "4.0.1-rc2-24027",
22+
"System.Security.Cryptography.Algorithms": "4.1.0-rc2-24027",
23+
"System.Reflection.TypeExtensions": "4.1.0-rc2-24027",
24+
"System.Runtime.Extensions": "4.1.0-rc2-24027",
25+
"System.Net.Primitives": "4.0.11-rc2-24027"
26+
},
1027
"frameworks": {
11-
"net46": { },
12-
"net461": { },
13-
"dotnet54": {
14-
"dependencies": {
15-
"Microsoft.CSharp": "4.0.1-beta-23516",
16-
"System.Collections": "4.0.11-beta-23516",
17-
"System.Linq": "4.0.1-beta-23516",
18-
"System.Runtime": "4.0.21-beta-23516",
19-
"System.Threading": "4.0.11-beta-23516",
20-
"System.Net.Utilities": "4.0.0-beta-23516",
21-
"System.Collections.Specialized": "4.0.1-beta-23516"
22-
}
28+
"netstandard1.3": {
29+
"imports": "dnxcore50"
2330
}
24-
},
25-
"dependencies": {
26-
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
27-
"System.Reflection.TypeExtensions": "4.1.0-beta-23516"
2831
}
2932
}

Diff for: test/LibPacketGremlinTests/LibPacketGremlinTests.xproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ProjectGuid>1e6e6dd7-a211-4985-a3c1-60488cb08709</ProjectGuid>
1010
<RootNamespace>LibPacketGremlinTests</RootNamespace>
1111
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>

Diff for: test/LibPacketGremlinTests/Packets/RadiotapTests.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class RadiotapTests
1515
[Fact]
1616
public void ParsesBasicFields()
1717
{
18-
byte[] rawBytes = System.IO.File.ReadAllBytes("Resources\\radiotap.bin");
18+
19+
byte[] rawBytes = System.IO.File.ReadAllBytes(Path.Combine("Resources","radiotap.bin"));
1920
Radiotap packet;
2021
var parseResult = RadiotapFactory.Instance.TryParse(rawBytes, out packet);
2122

@@ -30,7 +31,7 @@ public void ParsesBasicFields()
3031
[Fact]
3132
public void SerializesCorrectly()
3233
{
33-
byte[] rawBytes = System.IO.File.ReadAllBytes("Resources\\radiotap.bin");
34+
byte[] rawBytes = System.IO.File.ReadAllBytes(Path.Combine("Resources","radiotap.bin"));
3435

3536
Radiotap packet;
3637
var parseResult = RadiotapFactory.Instance.TryParse(rawBytes, out packet);
@@ -48,7 +49,7 @@ public void SerializesCorrectly()
4849
[Fact]
4950
public void CalculatesLength()
5051
{
51-
byte[] rawBytes = System.IO.File.ReadAllBytes("Resources\\radiotap.bin");
52+
byte[] rawBytes = System.IO.File.ReadAllBytes(Path.Combine("Resources","radiotap.bin"));
5253
Radiotap packet;
5354
var parseResult = RadiotapFactory.Instance.TryParse(rawBytes, out packet);
5455

Diff for: test/LibPacketGremlinTests/project.json

+18-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
{
22
"version": "1.0.0-*",
3-
"description": "LibPacketGremlinTests Class Library",
4-
"authors": [ "SapientGuardian" ],
5-
"tags": [ "" ],
6-
"projectUrl": "",
7-
"licenseUrl": "",
3+
84
"dependencies": {
9-
"FluentAssertions": "4.0.0-beta0001",
10-
"Microsoft.Dnx.TestHost": "1.0.0-rc1-final",
11-
"Microsoft.Dnx.Testing.Abstractions": "1.0.0-rc1-final",
5+
"Microsoft.NETCore.App": {
6+
"version": "1.0.0-rc2-3002702",
7+
"type": "platform"
8+
},
129
"xunit": "2.1.0",
13-
"xunit.runner.dnx": "2.1.0-rc1-build204",
14-
"LibPacketGremlin": ""
15-
},
16-
"commands": {
17-
"test": "xunit.runner.dnx"
10+
"dotnet-test-xunit": "1.0.0-*",
11+
"FluentAssertions": "4.6.1",
12+
"LibPacketGremlin": "1.0.0-rc2-*"
1813
},
14+
1915
"frameworks": {
20-
"dnx46": {
21-
"frameworkAssemblies": {
22-
"System.Runtime": "4.0.0.0"
23-
}
16+
"netcoreapp1.0": {
17+
"imports": [
18+
"dotnet5.6",
19+
"dnxcore50",
20+
"portable-net45+win8"
21+
]
2422
}
25-
}
26-
}
23+
},
24+
"testRunner": "xunit"
25+
}

0 commit comments

Comments
 (0)