Check-in [5a41ff9aa1]
Overview
Comment:Added provider test cases
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | crypto
Files: files | file ages | folders
SHA3-256: 5a41ff9aa1437195bd47c35a30226f315111b74dad30e4f2d9e5505c84ca5849
User & Date: bohagan on 2024-02-06 02:42:36
Other Links: branch diff | manifest | tags
Context
2024-02-11
20:51
Merged changes from master. check-in: 45be9618dc user: bohagan tags: crypto
2024-02-06
02:42
Added provider test cases check-in: 5a41ff9aa1 user: bohagan tags: crypto
2024-02-05
01:37
Added provider command to load non-default providers in OpenSSL 3.0 check-in: b6001442d1 user: bohagan tags: crypto
Changes
236
237
238
239
240
241
242
243

244
245
246
247
248
249
250
236
237
238
239
240
241
242

243
244
245
246
247
248
249
250







-
+







static void
MessageCallback(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg) {
    State *statePtr = (State*)arg;
    Tcl_Interp *interp	= statePtr->interp;
    Tcl_Obj *cmdPtr;
    char *ver, *type;
    BIO *bio;
    char buffer[15000];
    char buffer[30000];
    buffer[0] = 0;

    dprintf("Called");

    if (statePtr->callback == (Tcl_Obj*)NULL)
	return;

943
944
945
946
947
948
949
950

951
952
953
954
955
956
957
943
944
945
946
947
948
949

950
951
952
953
954
955
956
957







-
+







    char *name;
    (void) clientData;

    dprintf("Called");

    /* Validate arg count */
    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "provider");
	Tcl_WrongNumArgs(interp, 1, objv, "name");
	return TCL_ERROR;
    }

    name = Tcl_GetStringFromObj(objv[1], NULL);
    if (!OSSL_PROVIDER_try_load(NULL, (const char *) name, 1)) {
	Tcl_AppendResult(interp, GET_ERR_REASON(), (char *) NULL);
	return TCL_ERROR;
74
75
76
77
78
79
80
81
82
83
84
85
86












74
75
76
77
78
79
80






81
82
83
84
85
86
87
88
89
90
91
92







-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
Protocols,All,,,lcompare $::protocols [::tls::protocols],,,missing {ssl2 ssl3} unexpected {},,,
,,,,,,,,,,
command,# Test show version,,,,,,,,,
Version,All,,,::tls::version,,glob,*,,,
Version,OpenSSL,OpenSSL,,::tls::version,,glob,OpenSSL*,,,
,,,,,,,,,,
command,# Error Cases,,,,,,,,,
Error Cases,Cipher Too many args,,,::tls::cipher too many args,,,"wrong # args: should be ""::tls::cipher ?name?""",,,1
Error Cases,Digests Too many args,,,::tls::digests too many args,,,"wrong # args: should be ""::tls::digests ?name?""",,,1
Error Cases,MACs Too many args,,,::tls::macs too many args,,,"wrong # args: should be ""::tls::macs ?name?""",,,1
Error Cases,Pkeys Too many args,,,::tls::pkeys too many args,,,"wrong # args: should be ""::tls::pkeys ?name?""",,,1
Error Cases,Protocols Too many args,,,::tls::protocols too many args,,,"wrong # args: should be ""::tls::protocols""",,,1
Error Cases,Version Too many args,,,::tls::version too many args,,,"wrong # args: should be ""::tls::version""",,,1
Error Cases,Cipher too many args,,,::tls::cipher too many args,,,"wrong # args: should be ""::tls::cipher ?name?""",,,1
Error Cases,Digests too many args,,,::tls::digests too many args,,,"wrong # args: should be ""::tls::digests ?name?""",,,1
Error Cases,MACs too many args,,,::tls::macs too many args,,,"wrong # args: should be ""::tls::macs ?name?""",,,1
Error Cases,Pkeys too many args,,,::tls::pkeys too many args,,,"wrong # args: should be ""::tls::pkeys ?name?""",,,1
Error Cases,Protocols too many args,,,::tls::protocols too many args,,,"wrong # args: should be ""::tls::protocols""",,,1
Error Cases,Version too many args,,,::tls::version too many args,,,"wrong # args: should be ""::tls::version""",,,1
,,,,,,,,,,
command,# Provider command,,,,,,,,,
Provider,Provider too few args,new_api,,::tls::provider,,,"wrong # args: should be ""::tls:provider name""",,,1
Provider,Provider too few args,new_api,,::tls::provider too many args,,,"wrong # args: should be ""::tls:provider name""",,,1
Provider,Provider invalid arg,new_api,,::tls::provider invalid,,,could not load the shared library,,,1
Provider,Provider legacy provider,new_api,,::tls::provider legacy,,,,,,
208
209
210
211
212
213
214
215

216
217
218
219

220
221
222
223

224
225
226
227

228
229
230
231

232
233
234
235

236
237



















238
239
240
241
208
209
210
211
212
213
214

215
216
217
218

219
220
221
222

223
224
225
226

227
228
229
230

231
232
233
234

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260







-
+



-
+



-
+



-
+



-
+



-
+


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+




test Version-12.2 {OpenSSL} -constraints {OpenSSL} -body {
	::tls::version
    } -match {glob} -result {OpenSSL*}

# Error Cases


test Error_Cases-13.1 {Cipher Too many args} -body {
test Error_Cases-13.1 {Cipher too many args} -body {
	::tls::cipher too many args
    } -result {wrong # args: should be "::tls::cipher ?name?"} -returnCodes {1}

test Error_Cases-13.2 {Digests Too many args} -body {
test Error_Cases-13.2 {Digests too many args} -body {
	::tls::digests too many args
    } -result {wrong # args: should be "::tls::digests ?name?"} -returnCodes {1}

test Error_Cases-13.3 {MACs Too many args} -body {
test Error_Cases-13.3 {MACs too many args} -body {
	::tls::macs too many args
    } -result {wrong # args: should be "::tls::macs ?name?"} -returnCodes {1}

test Error_Cases-13.4 {Pkeys Too many args} -body {
test Error_Cases-13.4 {Pkeys too many args} -body {
	::tls::pkeys too many args
    } -result {wrong # args: should be "::tls::pkeys ?name?"} -returnCodes {1}

test Error_Cases-13.5 {Protocols Too many args} -body {
test Error_Cases-13.5 {Protocols too many args} -body {
	::tls::protocols too many args
    } -result {wrong # args: should be "::tls::protocols"} -returnCodes {1}

test Error_Cases-13.6 {Version Too many args} -body {
test Error_Cases-13.6 {Version too many args} -body {
	::tls::version too many args
    } -result {wrong # args: should be "::tls::version"} -returnCodes {1}

# Provider command


test Provider-14.1 {Provider too few args} -constraints {new_api} -body {
	::tls::provider
    } -result {wrong # args: should be "::tls:provider name"} -returnCodes {1}

test Provider-14.2 {Provider too few args} -constraints {new_api} -body {
	::tls::provider too many args
    } -result {wrong # args: should be "::tls:provider name"} -returnCodes {1}

test Provider-14.3 {Provider invalid arg} -constraints {new_api} -body {
	::tls::provider invalid
    } -result {could not load the shared library} -returnCodes {1}

test Provider-14.4 {Provider legacy provider} -constraints {new_api} -body {
	::tls::provider legacy
    }

# Cleanup
::tcltest::cleanupTests
return