Skip to content

Commit

Permalink
fix: Direct encryption algorithm name
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed Apr 6, 2024
1 parent 141b8cd commit 33a6dc3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,5 +468,5 @@ extension JSONWebAlgorithm where Self == JSONWebKeyEncryptionAlgorithm {
public static var ecdhEphemeralStaticAESKeyWrap256: Self { "ECDH-ES+A256KW" }

/// **Key Management**: No encryption for content key.
public static var direct: Self { "direct" }
public static var direct: Self { "dir" }
}
2 changes: 1 addition & 1 deletion Sources/JWSETKit/Entities/JWS/JWS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public struct JSONWebSignature<Payload: ProtectedWebContainer>: Hashable, Sendab

extension String {
public init<Payload: ProtectedWebContainer>(jws: JSONWebSignature<Payload>) throws {
var encoder = JSONEncoder.encoder
let encoder = JSONEncoder.encoder
encoder.userInfo[.jwsEncodedRepresentation] = JSONWebSignatureRepresentation.compact
self = try String(String(decoding: encoder.encode(jws), as: UTF8.self).dropFirst().dropLast())
}
Expand Down
6 changes: 2 additions & 4 deletions Sources/JWSETKit/Extensions/Lock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

final class ReadWriteLock: Sendable {
final class ReadWriteLock: @unchecked Sendable {
private let lock: UnsafeMutablePointer<pthread_rwlock_t>

init() {
Expand Down Expand Up @@ -39,7 +39,7 @@ final class ReadWriteLock: Sendable {

/// Synchronizing read and writes on a shared mutable property.
@propertyWrapper
public struct ReadWriteLocked<T> {
public final class ReadWriteLocked<T>: @unchecked Sendable {
private let lock = ReadWriteLock()
private var _value: T

Expand All @@ -56,5 +56,3 @@ public struct ReadWriteLocked<T> {
self._value = wrappedValue
}
}

extension ReadWriteLocked: Sendable where T: Sendable {}

0 comments on commit 33a6dc3

Please sign in to comment.