Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #1

Merged
merged 51 commits into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1f6615b
Check whether filename is a child of the current file (Fixes #341)
hierynomus Jul 25, 2017
8856aae
Fixed codacy
hierynomus Aug 22, 2017
eb1629f
Updated README release notes
hierynomus Aug 24, 2017
0b548d9
Removed oraclejdk7 as that is no longer supported on trusty, added op…
hierynomus Aug 24, 2017
c58c7c7
Added gradle caching to travis config
hierynomus Aug 24, 2017
cf077e2
Removed use of DataTypeConverter as that is no longer in default JDK9
hierynomus Aug 24, 2017
aa77483
Removed build of broken openJDK7 in favour of using animal-sniffer to…
hierynomus Aug 24, 2017
0918bc6
Improved test stability
hierynomus Aug 24, 2017
c6c9a3f
Correctly determine KeyType for ECDSA public key (Fixes #356)
hierynomus Sep 5, 2017
a9928c2
fixed build
hierynomus Sep 5, 2017
9ac55de
Fixed Java9 build?
hierynomus Sep 7, 2017
bdbd9d7
Disambiguated signature initialization
Sep 5, 2017
2984291
Removed deprecated method
Sep 7, 2017
28d5784
Organised imports
hierynomus Sep 19, 2017
99c8567
Added 'out/' to gitignore
hierynomus Sep 19, 2017
762d088
Added support for new-style fingerprints (#365)
hierynomus Sep 28, 2017
ec46a7a
Fix decoding signature bytes (Fixes #355, #354) (#361)
hierynomus Sep 29, 2017
c161fe2
Extracted ASN.1/DER encoding to method (#368)
Oct 4, 2017
f046a41
Update net.i2p.crypto:eddsa to 0.2.0 (#372)
paladox Oct 11, 2017
823f1e5
Log security provider registration failures (#374)
Oct 11, 2017
c67ae24
Migrate remaining block ciphers
Oct 10, 2017
fef9cfa
Merge pull request #369 from charlesrgould/migrate-block-ciphers
hierynomus Oct 11, 2017
a1f501a
Updated README for v0.23.0 release
hierynomus Oct 13, 2017
b41f0ac
Using new release plugin
hierynomus Oct 16, 2017
d2e0f50
Updated build plugins
hierynomus Nov 9, 2017
a71a7d7
Fix escaping in WildcardHostMatcher (#382)
hierynomus Nov 13, 2017
661f63e
Updated builds to include CodeCov
hierynomus Nov 30, 2017
7a884d0
- Experimenting with travis
Dec 3, 2017
c4552d5
- fix ip for online testing
Dec 3, 2017
47d73a9
- account for different working dir
Dec 3, 2017
663f118
- yaml-yaml
Dec 3, 2017
8454cf1
- double before_install
Dec 3, 2017
a014567
- still -d
Dec 3, 2017
0e981f7
- try common format
Dec 3, 2017
a0f1aa7
- Fixed server keys
Dec 3, 2017
2b62492
- grr, ip
Dec 3, 2017
9d697ed
- minor improvements
Dec 3, 2017
73bc785
- eh?
Dec 3, 2017
7cb1f8b
- switch username back
Dec 3, 2017
64a2a4f
- orly?
Dec 3, 2017
d0daa2c
- desperation
Dec 3, 2017
4045d5a
- One more time
Dec 3, 2017
09fb2b9
Merge pull request #385 from Igerly/ssh-with-docker-tests
hierynomus Dec 3, 2017
bc4da2e
Upgraded gradle to cope with java9
hierynomus Dec 27, 2017
5e1be8b
Separated out integration tests
hierynomus Dec 27, 2017
8ca6451
Fixed length bug in putString (Fixes #187)
hierynomus Dec 27, 2017
048f84b
Removed docker from travis yml as it is included in gradle build now
hierynomus Dec 28, 2017
ca81c2e
Added integration test to travis
hierynomus Dec 28, 2017
54018a4
Update AndroidConfig (#389)
eidottermihi Dec 28, 2017
0f67fa2
Added integration test for append scenario (Fixes #390)
hierynomus Dec 28, 2017
dabe43d
Fixed headers
hierynomus Dec 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.settings/

# Output dirs
out/
target/
classes/
build/
Expand Down
29 changes: 27 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
language: java
sudo: false
dist: trusty
sudo: required

services:
- docker

jdk:
- oraclejdk7
- oraclejdk8
- openjdk8
- oraclejdk9

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_install:
- pip install --user codecov

script:
- ./gradlew check
- ./gradlew integrationTest

after_success:
- codecov
18 changes: 15 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
= sshj - SSHv2 library for Java
Jeroen van Erp
:sshj_groupid: com.hierynomus
:sshj_version: 0.21.1
:sshj_version: 0.23.0
:source-highlighter: pygments

image:https://api.bintray.com/packages/hierynomus/maven/sshj/images/download.svg[link="https://bintray.com/hierynomus/maven/sshj/_latestVersion"]
image:https://travis-ci.org/hierynomus/sshj.svg?branch=master[link="https://travis-ci.org/hierynomus/sshj"]
image:https://api.codacy.com/project/badge/Grade/14a0a316bb9149739b5ea26dbfa8da8a["Codacy code quality", link="https://www.codacy.com/app/jeroen_2/sshj?utm_source=github.com&utm_medium=referral&utm_content=hierynomus/sshj&utm_campaign=Badge_Grade"]
image:https://codecov.io/gh/hierynomus/sshj/branch/master/graph/badge.svg["codecov", link="https://codecov.io/gh/hierynomus/sshj"]
image:http://www.javadoc.io/badge/com.hierynomus/sshj.svg?color=blue["JavaDocs", link="http://www.javadoc.io/doc/com.hierynomus/sshj"]
image:https://maven-badges.herokuapp.com/maven-central/com.hierynomus/sshj/badge.svg["Maven Central",link="https://maven-badges.herokuapp.com/maven-central/com.hierynomus/sshj"]
image:https://javadoc-emblem.rhcloud.com/doc/com.hierynomus/sshj/badge.svg["Javadoc",link="http://www.javadoc.io/doc/com.hierynomus/sshj"]

Expand Down Expand Up @@ -75,7 +78,7 @@ key exchange::
`diffie-hellman-group16-sha256`, `[email protected]`, `[email protected]`, `[email protected]`

signatures::
`ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ssh-ed25519`
`ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `ssh-ed25519`

mac::
`hmac-md5`, `hmac-md5-96`, `hmac-sha1`, `hmac-sha1-96`, `hmac-sha2-256`, `hmac-sha2-512`
Expand Down Expand Up @@ -104,7 +107,16 @@ Google Group: http://groups.google.com/group/sshj-users
Fork away!

== Release history
SSHJ 0.22.0 (2017-??-??)::
SSHJ 0.23.0 (2017-10-13)::
* Merged https://github.com/hierynomus/sshj/pulls/372[#372]: Upgrade to 'net.i2p.crypto:eddsa:0.2.0'
* Fixed https://github.com/hierynomus/sshj/issues/355[#355] and https://github.com/hierynomus/sshj/issues/354[#354]: Correctly decode signature bytes
* Fixed https://github.com/hierynomus/sshj/issues/365[#365]: Added support for new-style OpenSSH fingerprints of server keys
* Fixed https://github.com/hierynomus/sshj/issues/356[#356]: Fixed key type detection for ECDSA public keys
* Made SSHJ Java9 compatible
SSHJ 0.22.0 (2017-08-24)::
* Fixed https://github.com/hierynomus/sshj/pulls/341[#341]: Fixed path walking during recursive copy
* Merged https://github.com/hierynomus/sshj/pulls/338[#338]: Added ConsolePasswordFinder to read password from stdin
* Merged https://github.com/hierynomus/sshj/pulls/336[#336]: Added support for ecdsa-sha2-nistp384 and ecdsa-sha2-nistp521 signatures
* Fixed https://github.com/hierynomus/sshj/issues/331[#331]: Added support for wildcards in known_hosts file
SSHJ 0.21.1 (2017-04-25)::
* Merged https://github.com/hierynomus/sshj/pulls/322[#322]: Fix regression from 40f956b (invalid length parameter on outputstream)
Expand Down
115 changes: 85 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
import java.text.SimpleDateFormat
import com.bmuschko.gradle.docker.tasks.container.*
import com.bmuschko.gradle.docker.tasks.image.*

plugins {
id "java"
id "groovy"
id "jacoco"
id "osgi"
id "maven-publish"
id "org.ajoberstar.release-opinion" version "1.4.2"
id "com.bmuschko.docker-remote-api" version "3.2.1"
id 'pl.allegro.tech.build.axion-release' version '1.8.1'
id "com.github.hierynomus.license" version "0.12.1"
id "com.jfrog.bintray" version "1.7"
id 'ru.vyarus.pom' version '1.0.3'
id 'ru.vyarus.java-lib' version '1.0.5'
// id 'ru.vyarus.pom' version '1.0.3'
id 'ru.vyarus.github-info' version '1.1.0'
id 'ru.vyarus.animalsniffer' version '1.4.2'
}

group = "com.hierynomus"

defaultTasks "build"

repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/mockito/maven/"
}
}

sourceCompatibility = 1.6
targetCompatibility = 1.6

configurations.compile.transitive = false

def bouncycastleVersion = "1.56"
def bouncycastleVersion = "1.57"

dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'

compile "org.slf4j:slf4j-api:1.7.7"
compile "org.bouncycastle:bcprov-jdk15on:$bouncycastleVersion"
compile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
compile "com.jcraft:jzlib:1.1.3"

compile "net.i2p.crypto:eddsa:0.1.0"
compile "net.i2p.crypto:eddsa:0.2.0"

testCompile "junit:junit:4.11"
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile "org.mockito:mockito-core:2.8.47"
testCompile "org.mockito:mockito-core:2.9.2"
testCompile "org.apache.sshd:sshd-core:1.2.0"
testRuntime "ch.qos.logback:logback-classic:1.1.2"
testCompile 'org.glassfish.grizzly:grizzly-http-server:2.3.17'
Expand All @@ -53,14 +65,19 @@ license {
excludes(['**/djb/Curve25519.java', '**/sshj/common/Base64.java'])
}

if (project.file('.git').isDirectory()) {
release {
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
scmVersion {
tag {
prefix = 'v'
versionSeparator = ''
}
hooks {
pre 'fileUpdate', [file: 'README.adoc', pattern: { v, c -> /:sshj_version: .*/}, replacement: { v, c -> ":sshj_version: $v" }]
pre 'commit'
}
} else {
version = "0.0.0-no.git"
}

project.version = scmVersion.version

// This disables the pedantic doclint feature of JDK8
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
Expand All @@ -78,7 +95,6 @@ task writeSshjVersionProperties {
}

jar.dependsOn writeSshjVersionProperties

jar {
manifest {
// please see http://bnd.bndtools.org/chapters/390-wrapping.html
Expand All @@ -99,14 +115,7 @@ jar {
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
sourcesJar {
manifest {
attributes(
// Add the needed OSGI attributes
Expand All @@ -119,6 +128,27 @@ task sourcesJar(type: Jar) {
}
}

configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}

sourceSets {
integrationTest {
groovy {
compileClasspath += sourceSets.main.output + sourceSets.test.output
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
srcDir file('src/itest/groovy')
}
resources.srcDir file('src/itest/resources')
}
}

task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}

tasks.withType(Test) {
testLogging {
exceptionFormat = 'full'
Expand Down Expand Up @@ -185,21 +215,12 @@ pom {
}
}

publishing.publications {
Sshj(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}


if (project.hasProperty("bintrayUsername") && project.hasProperty("bintrayApiKey")) {
bintray {
user = project.property("bintrayUsername")
key = project.property("bintrayApiKey")
publish = true
publications = ["Sshj"]
publications = ["maven"]
pkg {
repo = "maven"
name = project.name
Expand All @@ -226,4 +247,38 @@ if (project.hasProperty("bintrayUsername") && project.hasProperty("bintrayApiKey
}
}

project.tasks.release.dependsOn([project.tasks.build, project.tasks.bintrayUpload])
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}


task buildItestImage(type: DockerBuildImage) {
inputDir = file('src/itest/docker-image')
tag = 'sshj/sshd-itest'
}

task createItestContainer(type: DockerCreateContainer) {
dependsOn buildItestImage
targetImageId { buildItestImage.getImageId() }
portBindings = ['2222:22']
}

task startItestContainer(type: DockerStartContainer) {
dependsOn createItestContainer
targetContainerId { createItestContainer.getContainerId() }
}

task stopItestContainer(type: DockerStopContainer) {
targetContainerId { createItestContainer.getContainerId() }
}

project.tasks.integrationTest.dependsOn(startItestContainer)
project.tasks.integrationTest.finalizedBy(stopItestContainer)

project.tasks.release.dependsOn([project.tasks.integrationTest, project.tasks.build])
project.tasks.release.finalizedBy(project.tasks.bintrayUpload)
project.tasks.jacocoTestReport.dependsOn(project.tasks.test)
project.tasks.check.dependsOn(project.tasks.jacocoTestReport)
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
16 changes: 16 additions & 0 deletions src/itest/docker-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM sickp/alpine-sshd:7.5

ADD id_rsa.pub /home/sshj/.ssh/authorized_keys

ADD test-container/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key
ADD test-container/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub

RUN \
echo "root:smile" | chpasswd && \
adduser -D -s /bin/ash sshj && \
passwd -u sshj && \
chmod 600 /home/sshj/.ssh/authorized_keys && \
chmod 600 /etc/ssh/ssh_host_ecdsa_key && \
chmod 644 /etc/ssh/ssh_host_ecdsa_key.pub && \
chown -R sshj:sshj /home/sshj

1 change: 1 addition & 0 deletions src/itest/docker-image/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAoZ9l6Tkm2aL1tSBy2yw4xU5s8BE9MfqS/4J7DzvsYJxF6oQmTIjmStuhH/CT7UjuDtKXdXZUsIhKtafiizxGO8kHSzKDeitpth2RSr8ddMzZKyD6RNs7MfsgjA3UTtrrSrCXEY6O43S2cnuJrWzkPxtwxaQ3zOvDbS2tiulzyq0VzYmuhA/a4CyuQtJBuu+P2oqmu6pU/VB6IzONpvBvYbNPsH1WDmP7zko5wHPihXPCliztspKxS4DRtOZ7BGXyvg44UmIy0Kf4jOkaBV/eCCA4qH7ZHz71/5ceMOpszPcNOEmLGGYhwI+P3OuGMpkrSAv1f8IY6R8spZNncP6UaQ== no-passphrase
5 changes: 5 additions & 0 deletions src/itest/docker-image/test-container/ssh_host_ecdsa_key
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIOpOBFjqe0hjK/hs4WZ3dZqnzanq1L3/JbvV1TCkbe4ToAoGCCqGSM49
AwEHoUQDQgAEVzkrS7Yj0nXML7A3mE08YDthfBR/ZbyYJDIq1vTzcqs6KTaCT529
swNXWLHO+mbHviZcRiI57ULXHZ1emom/Jw==
-----END EC PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFc5K0u2I9J1zC+wN5hNPGA7YXwUf2W8mCQyKtb083KrOik2gk+dvbMDV1ixzvpmx74mXEYiOe1C1x2dXpqJvyc= root@404b27be2bf4
36 changes: 36 additions & 0 deletions src/itest/groovy/com/hierynomus/sshj/IntegrationBaseSpec.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C)2009 - SSHJ Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hierynomus.sshj

import net.schmizz.sshj.DefaultConfig
import net.schmizz.sshj.SSHClient
import net.schmizz.sshj.transport.verification.PromiscuousVerifier
import spock.lang.Specification

class IntegrationBaseSpec extends Specification {
protected static final int DOCKER_PORT = 2222;
protected static final String USERNAME = "sshj";
protected final static String SERVER_IP = System.getProperty("serverIP", "127.0.0.1");

protected static SSHClient getConnectedClient() throws IOException {
SSHClient sshClient = new SSHClient(new DefaultConfig());
sshClient.addHostKeyVerifier(new PromiscuousVerifier());
sshClient.connect(SERVER_IP, DOCKER_PORT);

return sshClient;
}

}
Loading