Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
apldev4 committed Sep 6, 2018
0 parents commit d7e44b8
Show file tree
Hide file tree
Showing 1,262 changed files with 244,470 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# compiled python for systems tests
*.pyc

# NetBeans specific #
private/
build/
dist/
.nb-gradle-properties

# Eclipse specific #
.classpath
.project
.settings/
.checkstyle

# IDEA specific #
*.iml
.idea
cmake-build-debug/

# Gradle specific #
.gradle

# Class Files #
*.class
classes/

# Package Files #
*.war
*.ear
*.rpm
*.deb

# Specific RPMs used for testing
!HIRS_Utils/src/test/resources/repository/vim-common-7.2.411-1.8.el6.x86_64.rpm
!HIRS_Utils/src/test/resources/repository/kernel-2.6.32-642.6.1.el6.x86_64.rpm
!HIRS_Utils/src/test/resources/testrepo/*
!Systems_Tests/resources/**

# DEB Sources #
DEB_SOURCES/

# RPM Files #
BUILD/
BUILDROOT/
SOURCES/
SPECS/
RPM/
SRPM/
PLUGIN_SOURCE/

# C++ Files #
*.o

# Vagrant Files #
.vagrant/
.vagrantfile.swp
vagrant/tmp/

# tpm_module #
tpm_module/tpm_module
main.o
main.d

# Misc Files #
*~
bin/
!package/extras/*/bin
*/test-output/

# MAC OSX Finder Files #
.DS_Store

# Log Files #
*.log

/.nb-gradle/


# rejected diff applications
*.rej

# cmake artifacts from manual build
cmake_install.cmake
HIRS_ProvisionerTPM2/*.cmake
HIRS_ProvisionerTPM2/HIRS_ProvisionerTPM2.cbp
HIRS_ProvisionerTPM2/CMakeCache.txt
Makefile
CMakeFiles/
HIRS_ProvisionerTPM2/DartConfiguration.tcl
HIRS_ProvisionerTPM2/lib/cpplint-download/
HIRS_ProvisionerTPM2/lib/cpplint/
HIRS_ProvisionerTPM2/lib/cpr-build/
HIRS_ProvisionerTPM2/lib/cpr-download/
HIRS_ProvisionerTPM2/lib/cpr-src/
HIRS_ProvisionerTPM2/lib/googletest-build/
HIRS_ProvisionerTPM2/lib/googletest-download/
HIRS_ProvisionerTPM2/lib/googletest-src/
HIRS_ProvisionerTPM2/lib/*.a
HIRS_ProvisionerTPM2/lib/*.so
HIRS_ProvisionerTPM2/install_manifest.txt
HIRS_ProvisionerTPM2/src/libTPM2_PROVISIONER_LIBRARY.a
HIRS_ProvisionerTPM2/test/CTestTestfile.cmake

# C++ Doxygen Documentation
HIRS_ProvisionerTPM2/docs/html/
HIRS_ProvisionerTPM2/docs/latex/
HIRS_ProvisionerTPM2/CMakeDoxyfile.in

# C++ Style Checker
HIRS_ProvisionerTPM2/lint

/*/out

HIRS_ProvisionerTPM2/cmake-build-debug

# autogenerated protobuf files
*.pb.cc
*.pb.h
HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/provisionerTpm2/ProvisionerTpm2.java

# these files are copied over by ProvisionerTPM2 CMake build
HIRS_ProvisionerTPM2/config/logging.properties
HIRS_ProvisionerTPM2/scripts/tpm_aca_provision
31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NOTE: if you are editing this, try using the lint tool to check your work before pushing: https://forge.outer.jhuapl.edu/ci/lint

before_script:
- echo "running CI jobs for HIRS"

stages:
- build

gradle_build:
stage: build
script: ./gradlew build
artifacts:
when: on_failure
untracked: true
expire_in: 3 days

rpm_build_centos6:
stage: build
script: ONLY_BUILD_EL6_RPMS=true ./package/package.centos.sh
artifacts:
paths:
- package/rpm/RPMS/
expire_in: 3 days

rpm_build_centos7:
stage: build
script: ONLY_BUILD_EL7_RPMS=true ./package/package.centos.sh
artifacts:
paths:
- package/rpm/RPMS/
expire_in: 3 days
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
All contributions to this project will be released as follows:

1. If you are a U.S. government employee, then your changes are exempt from copyright in the U.S. and will be released under the [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) [Universal license](https://creativecommons.org/publicdomain/zero/1.0/legalcode) worldwide.
1. If you are a not a U.S. government employee, then your changes will be released under the [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) [Universal license](https://creativecommons.org/publicdomain/zero/1.0/legalcode) in the U.S. and worldwide.

By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
9 changes: 9 additions & 0 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Disclaimer of Warranty
This Work is provided "as is." Any express or implied warranties, including but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the United States Government be liable for any direct, indirect, incidental, special, exemplary or consequential damages (including, but not limited to, procurement of substitute goods or services, loss of use, data or profits, or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this Guidance, even if advised of the possibility of such damage.

The User of this Work agrees to hold harmless and indemnify the United States Government, its agents and employees from every claim or liability (whether in tort or in contract), including attorneys' fees, court costs, and expenses, arising in direct consequence of Recipient's use of the item, including, but not limited to, claims or liabilities made for injury to or death of personnel of User or third parties, damage to or destruction of property of User or third parties, and infringement or other violations of intellectual property or technical data rights.

Nothing in this Work is intended to constitute an endorsement, explicit or implied, by the United States Government of any particular manufacturer's product or service.

## Disclaimer of Endorsement
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise, in this Work does not constitute an endorsement, recommendation, or favoring by the United States Government and shall not be used for advertising or product endorsement purposes.
83 changes: 83 additions & 0 deletions HIRS_AttestationCA/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apply plugin: 'war'
apply plugin: 'checkstyle'

evaluationDependsOn(':HIRS_Utils')

sourceCompatibility = 1.8

dependencies {
compile project(':TPM_Utils')
compile project(':HIRS_Structs')
compile project(':HIRS_Utils')

compile libs.bouncy_castle
compile libs.commons_codec
compile libs.commons_lang
compile libs.spring_webmvc
compile libs.log4j2
compile libs.log4j2_web
compile libs.protobuf_java

providedCompile libs.servlet_api

testCompile project(':HIRS_Utils').sourceSets.test.output
testCompile project(':HIRS_Utils').sourceSets.test.resources

testCompile libs.commons_lang
testCompile libs.spring_test
testCompile libs.mockito
testCompile libs.testng
testCompile libs.hsqldb
}

task generateProtoBuf(type:Exec) {
workingDir 'config'

commandLine './genJavaProtoBuf.sh'
}

compileJava.dependsOn generateProtoBuf

ext.configDir = new File(projectDir, 'config')
ext.checkstyleConfigDir = "$configDir/checkstyle"
checkstyle {
toolVersion = '5.7'
configFile = checkstyleConfigFile
configProperties.put('basedir', checkstyleConfigDir)
ignoreFailures = false
showViolations = true
}

war {
archiveName = 'HIRS_AttestationCA.war'
}

publishing {
publications {
maven(MavenPublication) {
artifactId 'hirs-attestationca'
artifact jar
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

configurations.runtime.allDependencies.each {
if (it.group != null && it.name != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)

if (it.excludeRules.size() > 0) {
def exclusionsNode = dependencyNode.appendNode('exclusions')
it.excludeRules.each { rule ->
def exclusionNode = exclusionsNode.appendNode('exclusion')
exclusionNode.appendNode('groupId', rule.group)
exclusionNode.appendNode('artifactId', rule.module)
}
}
}
}
}
}
}
}
14 changes: 14 additions & 0 deletions HIRS_AttestationCA/config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>

<suppress checks="MagicNumber" files=".*[/\\]src[/\\]test[/\\]+" />
<suppress checks="FinalParameters" files=".*[/\\]src[/\\]test[/\\]+" />
<suppress checks="JavadocPackage" files=".*[/\\]src[/\\]test[/\\]+" />
<suppress files="src/main/java/hirs/attestationca/configuration/provisionerTpm2/ProvisionerTpm2\.java" checks="[a-zA-Z0-9]*"/>

</suppressions>
16 changes: 16 additions & 0 deletions HIRS_AttestationCA/config/genJavaProtoBuf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Script to generate protobuf Java code. Called by gradle to compile the
# protobuf spec file to Java source. Generates the file
# hirs/attestationca/configuration/provisionerTpm2/ProvisionerTpm2.java.

dir=$(pwd)
# Relative paths are different when building locally versus on CI
if [[ "$dir" == *"package"* ]]; then
SRC_DIR=$dir/../../../../../../HIRS_ProvisionerTPM2/src
DEST_DIR=$dir/../src/main/java
else
SRC_DIR=../../HIRS_ProvisionerTPM2/src
DEST_DIR=../src/main/java
fi
protoc -I=$SRC_DIR --java_out=$DEST_DIR $SRC_DIR/ProvisionerTpm2.proto
Loading

0 comments on commit d7e44b8

Please sign in to comment.