ObjFW  Check-in [448629661d]

Overview
Comment:OFTLSStream: Add more error codes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 448629661dbb33f4cb9b5d1cd0a0b2bf994703acc2adbeb1396954846cbd18cb
User & Date: js on 2024-11-12 00:28:29
Other Links: manifest | tags
Context
2024-11-12
00:29
OFGnuTLSTLSStream: Use more error codes check-in: 909ad7d8c8 user: js tags: trunk
00:28
OFTLSStream: Add more error codes check-in: 448629661d user: js tags: trunk
2024-11-09
12:15
Update ChangeLog for 1.2.1 check-in: 828075b819 user: js tags: trunk
Changes

Modified src/OFTLSStream.h from [19a4dce33f] to [80f6ab9958].

29
30
31
32
33
34
35
36











37
38
39
40
41
42
43
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53







-
+
+
+
+
+
+
+
+
+
+
+







/**
 * @brief An enum representing an error of an OFTLSStream.
 */
typedef enum {
	/** @brief An unknown error. */
	OFTLSStreamErrorCodeUnknown,
	/** @brief Initialization of the TLS context failed. */
	OFTLSStreamErrorCodeInitializationFailed
	OFTLSStreamErrorCodeInitializationFailed,
	/** @brief Verification of the certificate failed. */
	OFTLSStreamErrorCodeCertificateVerificationFailed,
	/** @brief The certificate has an untrusted or unknown issuer. */
	OFTLSStreamErrorCodeCertificateIssuerUntrusted,
	/** @brief The certificate is for a different name. */
	OFTLSStreamErrorCodeCertificateNameMismatch,
	/** @brief The certificate has expired or is not yet valid. */
	OFTLSStreamErrorCodeCertificatedExpired,
	/** @brief The certificate has been revoked. */
	OFTLSStreamErrorCodeCertificateRevoked
} OFTLSStreamErrorCode;

/**
 * @protocol OFTLSStreamDelegate OFTLSStream.h ObjFW/ObjFW.h
 *
 * A delegate for OFTLSStream.
 */

Modified src/OFTLSStream.m from [9bf5b732e6] to [698fb25b59].

49
50
51
52
53
54
55










56
57
58
59
60
61
62
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72







+
+
+
+
+
+
+
+
+
+








OFString *
OFTLSStreamErrorCodeDescription(OFTLSStreamErrorCode errorCode)
{
	switch (errorCode) {
	case OFTLSStreamErrorCodeInitializationFailed:
		return @"Initialization of TLS context failed";
	case OFTLSStreamErrorCodeCertificateVerificationFailed:
		return @"Verification of the certificate failed";
	case OFTLSStreamErrorCodeCertificateIssuerUntrusted:
		return @"The certificate has an untrusted or unknown issuer";
	case OFTLSStreamErrorCodeCertificateNameMismatch:
		return @"The certificate is for a different name";
	case OFTLSStreamErrorCodeCertificatedExpired:
		return @"The certificate has expired or is not yet valid";
	case OFTLSStreamErrorCodeCertificateRevoked:
		return @"The certificate has been revoked";
	default:
		return @"Unknown error";
	}
}

@implementation OFTLSStreamHandshakeDelegate
- (void)dealloc