Skip to content

Commit

Permalink
Merge pull request #26 from OSGP/feature/FDP-1968-nieuwe-cipher-suite
Browse files Browse the repository at this point in the history
FDP-1968: nieuwe cipher suite
  • Loading branch information
loesimmens authored Sep 5, 2024
2 parents df5800d + a768938 commit 4ba7b60
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class IntegrationTestCoapClient {

@Value("\${config.psk.default-key}") private lateinit var defaultKey: String

@Value("\${config.coap.cipher-suites}") private lateinit var cipherSuites: List<CipherSuite>

init {
DtlsConfig.register()
CoapConfig.register()
Expand All @@ -54,7 +56,7 @@ class IntegrationTestCoapClient {
return Configuration.getStandard()
.set(CoapConfig.COAP_SECURE_PORT, coapsPort.toInt())
.set(DtlsConfig.DTLS_ROLE, DtlsConfig.DtlsRole.CLIENT_ONLY)
.set(DtlsConfig.DTLS_CIPHER_SUITES, listOf(CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256))
.set(DtlsConfig.DTLS_CIPHER_SUITES, cipherSuites)
}

private fun getUri(): String =
Expand Down
2 changes: 1 addition & 1 deletion application/src/integrationTest/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ config:
coap:
coaps-port: 55684
path: "sng"

deduplicator: NO_DEDUPLICATOR
max-active-peers: 20000
max-message-size: 1024
max-peer-inactivity-period: 24h
max-resource-body-size: 8192
preferred-block-size: 1024
cipher-suites: TLS_PSK_WITH_AES_128_CBC_SHA256, TLS_PSK_WITH_AES_128_GCM_SHA256

http:
url: "http://localhost:9000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.eclipse.californium.scandium.config.DtlsConfig
import org.eclipse.californium.scandium.config.DtlsConfig.DtlsRole
import org.eclipse.californium.scandium.config.DtlsConnectorConfig
import org.eclipse.californium.scandium.dtls.cipher.CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256
import org.eclipse.californium.scandium.dtls.cipher.CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256
import org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore
import org.gxf.standalonenotifyinggateway.coaphttpproxy.coap.configuration.properties.CoapProperties
import org.gxf.standalonenotifyinggateway.coaphttpproxy.coap.configuration.properties.UdpProperties
Expand Down Expand Up @@ -73,8 +74,10 @@ class CoapConfiguration(
config
.set(DtlsConfig.DTLS_ROLE, DtlsRole.SERVER_ONLY)
.set(DtlsConfig.DTLS_RECOMMENDED_CIPHER_SUITES_ONLY, false)
.set(DtlsConfig.DTLS_PRESELECTED_CIPHER_SUITES, listOf(TLS_PSK_WITH_AES_128_CBC_SHA256))
.set(DtlsConfig.DTLS_CIPHER_SUITES, listOf(TLS_PSK_WITH_AES_128_CBC_SHA256))
.set(
DtlsConfig.DTLS_PRESELECTED_CIPHER_SUITES,
listOf(TLS_PSK_WITH_AES_128_CBC_SHA256, TLS_PSK_WITH_AES_128_GCM_SHA256))
.set(DtlsConfig.DTLS_CIPHER_SUITES, coapProps.cipherSuites)
.set(DtlsConfig.DTLS_CLIENT_AUTHENTICATION_MODE, CertificateAuthenticationMode.NONE)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package org.gxf.standalonenotifyinggateway.coaphttpproxy.coap.configuration.properties

import java.time.Duration
import org.eclipse.californium.scandium.dtls.cipher.CipherSuite
import org.springframework.boot.context.properties.ConfigurationProperties

@ConfigurationProperties(prefix = "config.coap")
Expand All @@ -16,4 +17,5 @@ class CoapProperties(
val maxPeerInactivityPeriod: Duration,
val maxResourceBodySize: Int,
val preferredBlockSize: Int,
val cipherSuites: List<CipherSuite>
)
1 change: 0 additions & 1 deletion application/src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ config:
coap:
coaps-port: 55684
path: "sng"

de-duplicator: "NO_DEDUPLICATOR"
max-active-peers: 20000
max-message-size: 1024
Expand Down
2 changes: 2 additions & 0 deletions application/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spring:
config:
http:
ssl-bundle: "coap-http-proxy"
coap:
cipher-suites: TLS_PSK_WITH_AES_128_CBC_SHA256, TLS_PSK_WITH_AES_128_GCM_SHA256

management:
endpoints:
Expand Down

0 comments on commit 4ba7b60

Please sign in to comment.