Skip to content

Commit

Permalink
all platform signing provider signers should be attestable
Browse files Browse the repository at this point in the history
  • Loading branch information
iaik-jheher committed Oct 29, 2024
1 parent 78a3742 commit 033a466
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ sealed class AndroidKeystoreSigner private constructor(
val keyInfo: KeyInfo,
private val config: AndroidSignerConfiguration,
final override val attestation: AndroidKeystoreAttestation?
) : PlatformSigningProviderSigner<AndroidSignerSigningConfiguration>, SignerI.Attestable<AndroidKeystoreAttestation> {
) : PlatformSigningProviderSigner<AndroidSignerSigningConfiguration, AndroidKeystoreAttestation> {

final override val mayRequireUserUnlock: Boolean get() = this.needsAuthentication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package at.asitplus.signum.supreme.os

import at.asitplus.KmmResult
import at.asitplus.catching
import at.asitplus.signum.indispensable.Attestation
import at.asitplus.signum.indispensable.Digest
import at.asitplus.signum.indispensable.RSAPadding
import at.asitplus.signum.supreme.SignatureResult
Expand Down Expand Up @@ -139,8 +140,9 @@ open class PlatformSigningProviderSignerSigningConfigurationBase internal constr
open val unlockPrompt = childOrDefault(::UnlockPromptConfiguration)
}

interface PlatformSigningProviderSigner<SigningConfiguration: PlatformSigningProviderSignerSigningConfigurationBase>
: Signer.WithAlias {
interface PlatformSigningProviderSigner
<SigningConfiguration: PlatformSigningProviderSignerSigningConfigurationBase, AttestationT: Attestation>
: Signer.WithAlias, Signer.Attestable<AttestationT> {

suspend fun trySetupUninterruptedSigning(configure: DSLConfigureFn<SigningConfiguration> = null) : KmmResult<Unit> = KmmResult.success(Unit)
override suspend fun trySetupUninterruptedSigning() = trySetupUninterruptedSigning(null)
Expand All @@ -160,7 +162,7 @@ internal expect fun getPlatformSigningProvider(configure: DSLConfigureFn<Platfor

/** KT-71089 workaround
* @see PlatformSigningProvider */
interface PlatformSigningProviderI<out SignerT: PlatformSigningProviderSigner<*>,
interface PlatformSigningProviderI<out SignerT: PlatformSigningProviderSigner<*,*>,
out SignerConfigT: PlatformSignerConfigurationBase,
out KeyConfigT: PlatformSigningKeyConfigurationBase<*>>
: SigningProviderI<SignerT, SignerConfigT, KeyConfigT> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ typealias IosSignerSigningConfiguration = PlatformSigningProviderSignerSigningCo
sealed class IosSigner(final override val alias: String,
private val metadata: IosKeyMetadata,
private val signerConfig: IosSignerConfiguration)
: PlatformSigningProviderSigner<IosSignerSigningConfiguration>, Signer.Attestable<IosHomebrewAttestation> {
: PlatformSigningProviderSigner<IosSignerSigningConfiguration, IosHomebrewAttestation> {

override val mayRequireUserUnlock get() = needsAuthentication
val needsAuthentication get() = metadata.needsUnlock
Expand Down

0 comments on commit 033a466

Please sign in to comment.