Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed May 25, 2023
1 parent 32b517b commit 8e3a62a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import CZlib
public enum Decompression {

public struct Configuration {
/// `deflate` is the main compression algorithm for web-sockets (RFC 7692),
/// so for now we only support `deflate`.
/// For now we only support `deflate`, because it's the main compression
/// algorithm for web-sockets (RFC 7692).
let algorithm: Compression.Algorithm = .deflate

private init() { }
Expand All @@ -22,12 +22,12 @@ public enum Decompression {

private var base: Base

/// An error occurred when inflating. Error code is included to aid diagnosis.
/// An error occurred when inflating. Error code is included to aid diagnosis.
public static var inflationError: (Int) -> Self = {
Self(base: .inflationError($0))
}

/// Decoder could not be initialised. Error code is included to aid diagnosis.
/// Decoder could not be initialized. Error code is included to aid diagnosis.
public static var initializationError: (Int) -> Self = {
Self(base: .initializationError($0))
}
Expand Down
5 changes: 3 additions & 2 deletions Tests/WebSocketKitTests/SSLTestHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import Foundation
@_implementationOnly import CNIOBoringSSL

@testable import NIOSSL

// This function generates a random number suitable for use in an X509
Expand Down Expand Up @@ -61,7 +62,7 @@ func randomSerialNumber() -> ASN1_INTEGER {
return asn1int
}

func generateRSAPrivateKey() -> UnsafeMutablePointer<EVP_PKEY> {
func generateRSAPrivateKey() -> OpaquePointer /*<EVP_PKEY>*/ {
let exponent = CNIOBoringSSL_BN_new()
defer {
CNIOBoringSSL_BN_free(exponent)
Expand Down Expand Up @@ -91,7 +92,7 @@ func addExtension(x509: OpaquePointer, nid: CInt, value: String) {
CNIOBoringSSL_X509_EXTENSION_free(ext)
}

func generateSelfSignedCert(keygenFunction: () -> UnsafeMutablePointer<EVP_PKEY> = generateRSAPrivateKey) -> (NIOSSLCertificate, NIOSSLPrivateKey) {
func generateSelfSignedCert(keygenFunction: () -> OpaquePointer /*<EVP_PKEY>*/ = generateRSAPrivateKey) -> (NIOSSLCertificate, NIOSSLPrivateKey) {
let pkey = keygenFunction()
let x = CNIOBoringSSL_X509_new()!
CNIOBoringSSL_X509_set_version(x, 2)
Expand Down

0 comments on commit 8e3a62a

Please sign in to comment.