hierynomus / hierynomus/sshj

Possible broken assert in BaseFileKeyProvider.java

Open
#475 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.7k
Forks
620
Avg merge
3d 23h
Merged PRs (30d)
11

Description

The `init` method in `BaseFileKeyProvider.java` looks like it has an invalid `assert` statement on line 62. Here's the current code:

```
@Override
public void init(String privateKey, String publicKey) {
assert privateKey != null;
assert publicKey == null;
resource = new PrivateKeyStringResource(privateKey);
}
```

The second line doesn't make sense since this method is called whenever we are using a `privateKey` and a `publicKey` on the `SSHClient` object. It seems like it should be this code instead:

```
@Override
public void init(String privateKey, String publicKey) {
assert privateKey != null;
assert publicKey != null;
resource = new PrivateKeyStringResource(privateKey);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.