-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from DP-3T/develop
Merge into master for release 2.0.0
- Loading branch information
Showing
140 changed files
with
9,209 additions
and
17,813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: close-issues | ||
|
||
# (c) 2020 by Linus Gasser for C4DT.org | ||
# This action closes issues referenced in the PR in the case the merge | ||
# does not happen on the 'default' branch. | ||
# It searches for the same tags as the original github closers. | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [develop] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: script | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const pr = context.payload.pull_request; | ||
if (!pr.merged){ | ||
console.log("Don't close issues when PR is not merged"); | ||
return; | ||
} | ||
const body = pr.body; | ||
const lines = body.split('\n').map((l)=>l.trim()); | ||
const closers = new RegExp( | ||
/(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)/i); | ||
const issues = lines.filter((l)=>l.match(closers)); | ||
const issue_nbrs = issues.map((i) => i.replace(/.*#/, '')); | ||
issue_nbrs.forEach((i) => { | ||
console.log("Closing issue " + i); | ||
github.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: i, | ||
body: `Closed by PR #${pr.number} ${pr.title}` | ||
}); | ||
github.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: i, | ||
state: 'closed' | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [develop] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '11' | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repos: | ||
- repo: https://github.com/c4dt/google-style-precommit-hook | ||
rev: v1.0 | ||
hooks: | ||
- id: google-style-java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
/** | ||
* This file only serves as an example on how to get keys in the right encoding. | ||
* This outputs the keys in the PKCS8 format for the private key and the X509 format for the publickey | ||
* | ||
* DO NOT USE THEM IN PRODUCTION UNLESS THE KEYSPECS ARE OK FOR YOU | ||
* This file only serves as an example on how to get keys in the right encoding. This outputs the | ||
* keys in the PKCS8 format for the private key and the X509 format for the publickey | ||
* | ||
* <p>DO NOT USE THEM IN PRODUCTION UNLESS THE KEYSPECS ARE OK FOR YOU | ||
*/ | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.security.Key; | ||
import java.security.KeyPair; | ||
import java.security.KeyPairGenerator; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.PrivateKey; | ||
import java.security.PublicKey; | ||
import java.security.Security; | ||
import java.util.Base64; | ||
|
||
import java.security.Security; | ||
public class GenerateKeyPair { | ||
public static void main(String[] args) throws Exception { | ||
Security.setProperty("crypto.policy", "unlimited"); | ||
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); | ||
KeyPair pair = generator.genKeyPair(); | ||
PrivateKey privateKey = pair.getPrivate(); | ||
PublicKey publicKey = pair.getPublic(); | ||
FileOutputStream outputStream = new FileOutputStream("generated_pub.pem"); | ||
outputStream.write(Base64.getEncoder().encode(publicKey.getEncoded())); | ||
outputStream.close(); | ||
|
||
public class GenerateKeyPair{ | ||
public static void main(String[] args) throws Exception { | ||
Security.setProperty("crypto.policy", "unlimited"); | ||
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); | ||
KeyPair pair = generator.genKeyPair(); | ||
PrivateKey privateKey = pair.getPrivate(); | ||
PublicKey publicKey = pair.getPublic(); | ||
FileOutputStream outputStream = new FileOutputStream("generated_pub.pem"); | ||
outputStream.write(Base64.getEncoder().encode(publicKey.getEncoded())); | ||
outputStream.close(); | ||
|
||
outputStream = new FileOutputStream("generated_private.pem"); | ||
outputStream.write(Base64.getEncoder().encode(privateKey.getEncoded())); | ||
outputStream.close(); | ||
} | ||
} | ||
outputStream = new FileOutputStream("generated_private.pem"); | ||
outputStream.write(Base64.getEncoder().encode(privateKey.getEncoded())); | ||
outputStream.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,51 @@ | ||
/** | ||
* This file only serves as an example on how to get keys in the right encoding. | ||
* In order to use it you need BouncyCastle on the classpath! | ||
* | ||
* DO NOT USE THEM IN PRODUCTION UNLESS THE KEYSPECS ARE OK FOR YOU | ||
* This file only serves as an example on how to get keys in the right encoding. In order to use it | ||
* you need BouncyCastle on the classpath! | ||
* | ||
* <p>DO NOT USE THEM IN PRODUCTION UNLESS THE KEYSPECS ARE OK FOR YOU | ||
*/ | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.security.Key; | ||
import java.io.StringWriter; | ||
import java.security.KeyPair; | ||
import java.security.KeyPairGenerator; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.PrivateKey; | ||
import java.security.PublicKey; | ||
import java.util.Base64; | ||
import java.security.spec.ECGenParameterSpec; | ||
import java.io.StringWriter; | ||
|
||
import java.security.Security; | ||
import java.security.spec.ECGenParameterSpec; | ||
import java.util.Base64; | ||
import org.bouncycastle.jce.provider.BouncyCastleProvider; | ||
import org.bouncycastle.util.io.pem.PemWriter; | ||
import org.bouncycastle.util.io.pem.PemObject; | ||
import org.bouncycastle.util.io.pem.PemWriter; | ||
|
||
public class GenerateKeyPairEC { | ||
public static void main(String[] args) throws Exception { | ||
Security.addProvider(new BouncyCastleProvider()); | ||
Security.setProperty("crypto.policy", "unlimited"); | ||
KeyPairGenerator generator = KeyPairGenerator.getInstance("ECDSA", "BC"); | ||
ECGenParameterSpec spec = new ECGenParameterSpec("secp256r1"); | ||
generator.initialize(spec); | ||
KeyPair pair = generator.genKeyPair(); | ||
PrivateKey privateKey = pair.getPrivate(); | ||
PublicKey publicKey = pair.getPublic(); | ||
|
||
public class GenerateKeyPairEC{ | ||
public static void main(String[] args) throws Exception { | ||
Security.addProvider(new BouncyCastleProvider()); | ||
Security.setProperty("crypto.policy", "unlimited"); | ||
KeyPairGenerator generator = KeyPairGenerator.getInstance("ECDSA", "BC"); | ||
ECGenParameterSpec spec = new ECGenParameterSpec("secp256r1"); | ||
generator.initialize(spec); | ||
KeyPair pair = generator.genKeyPair(); | ||
PrivateKey privateKey = pair.getPrivate(); | ||
PublicKey publicKey = pair.getPublic(); | ||
StringWriter privateKeyWriter = new StringWriter(); | ||
PemWriter privateKeyPemWriter = new PemWriter(privateKeyWriter); | ||
privateKeyPemWriter.writeObject(new PemObject("PRIVATE KEY", privateKey.getEncoded())); | ||
privateKeyPemWriter.flush(); | ||
privateKeyPemWriter.close(); | ||
|
||
StringWriter privateKeyWriter = new StringWriter(); | ||
PemWriter privateKeyPemWriter = new PemWriter(privateKeyWriter); | ||
privateKeyPemWriter.writeObject(new PemObject("PRIVATE KEY", privateKey.getEncoded())); | ||
privateKeyPemWriter.flush(); | ||
privateKeyPemWriter.close(); | ||
StringWriter publicKeyWriter = new StringWriter(); | ||
PemWriter publicKeyPemWriter = new PemWriter(publicKeyWriter); | ||
publicKeyPemWriter.writeObject(new PemObject("PUBLIC KEY", publicKey.getEncoded())); | ||
publicKeyPemWriter.flush(); | ||
publicKeyPemWriter.close(); | ||
|
||
StringWriter publicKeyWriter = new StringWriter(); | ||
PemWriter publicKeyPemWriter = new PemWriter(publicKeyWriter); | ||
publicKeyPemWriter.writeObject(new PemObject("PUBLIC KEY", publicKey.getEncoded())); | ||
publicKeyPemWriter.flush(); | ||
publicKeyPemWriter.close(); | ||
FileOutputStream outputStream = new FileOutputStream("generated_pub.pem"); | ||
outputStream.write(Base64.getEncoder().encode(publicKeyWriter.toString().getBytes())); | ||
outputStream.close(); | ||
|
||
FileOutputStream outputStream = new FileOutputStream("generated_pub.pem"); | ||
outputStream.write(Base64.getEncoder().encode( | ||
publicKeyWriter.toString().getBytes() | ||
)); | ||
outputStream.close(); | ||
|
||
outputStream = new FileOutputStream("generated_private.pem"); | ||
outputStream.write(Base64.getEncoder().encode( | ||
privateKeyWriter.toString().getBytes() | ||
)); | ||
outputStream.close(); | ||
} | ||
} | ||
outputStream = new FileOutputStream("generated_private.pem"); | ||
outputStream.write(Base64.getEncoder().encode(privateKeyWriter.toString().getBytes())); | ||
outputStream.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
Currently eligble versions for patches are the following | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 1.x.x | :white_check_mark: | | ||
|
||
|
||
## Reporting a Vulnerability | ||
Please report (suspected) security vulnerabilities to [email protected]. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.