Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion protocol/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ apply(from = rootProject.file("gradle/publication-staging.gradle.kts"))

val kaitaiInputDir = file("src/main/resources/kaitai")
val kaitaiOutputDir = file("build/generated/kaitai")
val kaitaiCompiler by configurations.creating
val kaitaiCompiler = configurations.create("kaitaiCompiler")

abstract class KaitaiTask : JavaExec() {
@get:InputFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ doc: >
OpenSSH Security Key ECDSA P-256 public key blob.
Defined in OpenSSH PROTOCOL.u2f section 3.1.
seq:
- id: curve_name_len
- id: len_curve_name
type: u4
valid: 8
- id: curve_name
Expand Down
12 changes: 6 additions & 6 deletions protocol/src/main/resources/kaitai/ssh_certificate.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@ seq:
any-of: [1, 2]
- id: key_id
type: byte_string
- id: principals_len
- id: len_principals
type: u4
valid:
expr: _ <= _io.size - _io.pos
- id: principals
type: string_list
size: principals_len
size: len_principals
- id: valid_after
type: u8
- id: valid_before
type: u8
- id: critical_options_len
- id: len_critical_options
type: u4
valid:
expr: _ <= _io.size - _io.pos
- id: critical_options
type: options
size: critical_options_len
- id: extensions_len
size: len_critical_options
- id: len_extensions
type: u4
valid:
expr: _ <= _io.size - _io.pos
- id: extensions
type: options
size: extensions_len
size: len_extensions
- id: reserved
type: byte_string
- id: signature_key
Expand Down
4 changes: 2 additions & 2 deletions protocol/src/main/resources/kaitai/ssh_public_key.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ doc: >
Generic SSH public key structure. The key blob format is defined
by the public key algorithm.
seq:
- id: algorithm_name_len
- id: len_algorithm_name
type: u4
valid:
expr: _ <= _io.size - _io.pos
- id: algorithm_name
type: str
size: algorithm_name_len
size: len_algorithm_name
encoding: ASCII
- id: key_blob
type:
Expand Down
4 changes: 2 additions & 2 deletions protocol/src/main/resources/kaitai/ssh_signature.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ doc: >
Generic SSH signature structure. The signature blob format is defined
by the public key algorithm.
seq:
- id: algorithm_name_len
- id: len_algorithm_name
type: u4
valid:
expr: _ <= _io.size - _io.pos
- id: algorithm_name
type: str
size: algorithm_name_len
size: len_algorithm_name
encoding: ASCII
- id: signature_blob
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal object MldsaP384Codec {
_check()
}
return SshPublicKey().apply {
setAlgorithmNameLen(parameter.sshName.length.toLong())
setLenAlgorithmName(parameter.sshName.length.toLong())
setAlgorithmName(parameter.sshName)
setKeyBlob(body)
}.toByteArray()
Expand Down Expand Up @@ -102,7 +102,7 @@ internal object MldsaP384Codec {
_check()
}
return SshSignature().apply {
setAlgorithmNameLen(parameter.sshName.length.toLong())
setLenAlgorithmName(parameter.sshName.length.toLong())
setAlgorithmName(parameter.sshName)
setSignatureBlob(body)
}.toByteArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal class MldsaSignatureAlgorithm(private val parameter: MldsaAlgorithm) :
_check()
}
return SshSignature().apply {
setAlgorithmNameLen(parameter.sshName.length.toLong())
setLenAlgorithmName(parameter.sshName.length.toLong())
setAlgorithmName(parameter.sshName)
setSignatureBlob(body)
}.toByteArray()
Expand All @@ -81,7 +81,7 @@ internal class MldsaSignatureAlgorithm(private val parameter: MldsaAlgorithm) :
_check()
}
return SshPublicKey().apply {
setAlgorithmNameLen(keyType.length.toLong())
setLenAlgorithmName(keyType.length.toLong())
setAlgorithmName(keyType)
setKeyBlob(body)
}.toByteArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SshCertificateTest {
val option = extensions.entries().first()
val size = option.toByteArray().size
extensions.entries().add(option)
duplicate.setExtensionsLen(duplicate.extensionsLen() + size)
duplicate.setLenExtensions(duplicate.lenExtensions() + size)
assertFailsWith<SshException> { SshCertificate.decode(duplicate.toByteArray()) }
val invalidAlias = wire().apply {
setAlgorithmName(org.connectbot.sshlib.protocol.createAsciiString("rsa-sha2-512$CERTIFICATE_SUFFIX"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ internal class MldsaSignatureAlgorithmTest {
}
}

private class RejectingMldsaProvider : Provider("RejectingMldsa", 1.0, "Raw keys unavailable") {
private class RejectingMldsaProvider : Provider("RejectingMldsa", "1.0", "Raw keys unavailable") {
init {
for (parameter in MldsaAlgorithm.entries) {
put("KeyFactory.${parameter.jcaName}", RejectingMldsaKeyFactory::class.java.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class RawKeyFactoryTest {
}
}

class RejectingRawKeyProvider : Provider("RejectingRawKeyProvider", 1.0, "Rejects raw key material") {
class RejectingRawKeyProvider : Provider("RejectingRawKeyProvider", "1.0", "Rejects raw key material") {
init {
for (algorithm in listOf("RSA", "EC", "Ed25519", "Ed448", "X25519")) {
put("KeyFactory.$algorithm", RejectingRawKeyFactory::class.java.name)
Expand Down
Loading