Overview
Comment: | Updated to latest set of TCL 9.0 API changes. Made Tcl_Size updates. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | crypto |
Files: | files | file ages | folders |
SHA3-256: |
ce307ddd1f55cfb79b458c5d5114f828 |
User & Date: | bohagan on 2024-01-29 02:41:11 |
Other Links: | branch diff | manifest | tags |
Context
2024-02-04
| ||
03:31 | Merged changes from master branch check-in: fa17431520 user: bohagan tags: crypto | |
2024-01-29
| ||
02:41 | Updated to latest set of TCL 9.0 API changes. Made Tcl_Size updates. check-in: ce307ddd1f user: bohagan tags: crypto | |
2023-12-29
| ||
21:09 | Cast unused parameters to void to prevent unused parameter warnings Source: https://core.tcl-lang.org/tcltls/tktview/086954612f check-in: f586ebd433 user: bohagan tags: crypto | |
Changes
Modified generic/tlsDigest.c
from [fc965c1660]
to [71c1dbb17e].
︙ | |||
149 150 151 152 153 154 155 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - + | */ int DigestInitialize(Tcl_Interp *interp, DigestState *statePtr, Tcl_Obj *digestObj, Tcl_Obj *cipherObj, Tcl_Obj *keyObj, Tcl_Obj *macObj) { int res = 0, type = statePtr->format & 0xFF0; const EVP_MD *md = NULL; const EVP_CIPHER *cipher = NULL; const void *key = NULL, *iv = NULL, *salt = NULL; |
︙ | |||
189 190 191 192 193 194 195 | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | - + - + - + - + | case TYPE_CMAC: statePtr->cctx = CMAC_CTX_new(); res = (statePtr->cctx != NULL); break; } if (!res) { |
︙ | |||
229 230 231 232 233 234 235 | 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 261 | - + - + - + - + - + | * to error message if do_result is true. * * Side effects: * Adds buf data to hash function or sets result to error message * *------------------------------------------------------------------- */ |
︙ | |||
300 301 302 303 304 305 306 | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | - + - + - + - + | res = CMAC_Final(statePtr->cctx, md_buf, &size); md_len = (int) size; break; } if (!res) { if (resultObj == NULL) { |
︙ | |||
393 394 395 396 397 398 399 | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - + - - + + | statePtr->timer = (Tcl_TimerToken) NULL; } /* Output message digest if not already done */ if (!(statePtr->flags & CHAN_EOF)) { Tcl_Channel parent = Tcl_GetStackedChannel(statePtr->self); Tcl_Obj *resultObj; |
︙ | |||
439 440 441 442 443 444 445 | 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | - + - + - + - + - + | * Read data from transform and write to buf * *---------------------------------------------------------------------- */ int DigestInputProc(ClientData clientData, char *buf, int toRead, int *errorCodePtr) { DigestState *statePtr = (DigestState *) clientData; Tcl_Channel parent; |
︙ | |||
512 513 514 515 516 517 518 | 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | - + | /* Abort if nothing to process */ if (toWrite <= 0 || statePtr->self == (Tcl_Channel) NULL) { return 0; } /* Update hash function */ |
︙ | |||
858 859 860 861 862 863 864 | 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | - + | /* Validate arg count */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); return TCL_ERROR; } /* Get channel */ |
︙ | |||
898 899 900 901 902 903 904 | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | + - + | * Side effects: * Adds data to hash or returns message digest * *------------------------------------------------------------------- */ int DigestInstanceObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { DigestState *statePtr = (DigestState *) clientData; int fn; |
︙ | |||
926 927 928 929 930 931 932 | 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 | - + | data = Tcl_GetByteArrayFromObj(objv[2], &data_len); } else { Tcl_WrongNumArgs(interp, 1, objv, "update data"); return TCL_ERROR; } /* Update hash function */ |
︙ | |||
981 982 983 984 985 986 987 | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 | - + | * Creates command or error message * *------------------------------------------------------------------- */ int DigestCommandHandler(Tcl_Interp *interp, Tcl_Obj *cmdObj, Tcl_Obj *digestObj, Tcl_Obj *cipherObj, int format, Tcl_Obj *keyObj, Tcl_Obj *macObj) { DigestState *statePtr; |
︙ | |||
1030 1031 1032 1033 1034 1035 1036 | 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 | - + - + | * Sets result to message digest or error message * *------------------------------------------------------------------- */ int DigestDataHandler(Tcl_Interp *interp, Tcl_Obj *dataObj, Tcl_Obj *digestObj, Tcl_Obj *cipherObj, int format, Tcl_Obj *keyObj, Tcl_Obj *macObj) { char *data; |
︙ | |||
1083 1084 1085 1086 1087 1088 1089 | 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 | - + | *------------------------------------------------------------------- */ int DigestFileHandler(Tcl_Interp *interp, Tcl_Obj *inFileObj, Tcl_Obj *digestObj, Tcl_Obj *cipherObj, int format, Tcl_Obj *keyObj, Tcl_Obj *macObj) { DigestState *statePtr; Tcl_Channel chan = NULL; unsigned char buf[BUFFER_SIZE]; |
︙ | |||
1113 1114 1115 1116 1117 1118 1119 | 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 | - + - + | /* Initialize hash function */ if ((res = DigestInitialize(interp, statePtr, digestObj, cipherObj, keyObj, macObj)) != TCL_OK) { goto done; } /* Read file data and update hash function */ while (!Tcl_Eof(chan)) { |
︙ | |||
1163 1164 1165 1166 1167 1168 1169 | 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 | - + + - + - + | * * Side effects: * Sets result to message digest or error message * *------------------------------------------------------------------- */ static int DigestMain(int type, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { |
︙ | |||
1272 1273 1274 1275 1276 1277 1278 | 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 | - + - + - + - + | } else if (keyObj != NULL) { type = TYPE_HMAC; } } if (type == TYPE_MAC) { if (macObj != NULL) { |
︙ |
Modified generic/tlsEncrypt.c
from [e9efc0f8b2]
to [2d6388582b].
︙ | |||
135 136 137 138 139 140 141 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | - + + | * *------------------------------------------------------------------- */ int EncryptInitialize(Tcl_Interp *interp, int type, EVP_CIPHER_CTX **ctx, Tcl_Obj *cipherObj, Tcl_Obj *keyObj, Tcl_Obj *ivObj) { const EVP_CIPHER *cipher; char *keyString = NULL, *ivString = NULL; |
︙ | |||
183 184 185 186 187 188 189 | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | - + | if (type == TYPE_ENCRYPT) { res = EVP_EncryptInit_ex(*ctx, cipher, NULL, key, iv); } else { res = EVP_DecryptInit_ex(*ctx, cipher, NULL, key, iv); } if(!res) { |
︙ | |||
209 210 211 212 213 214 215 | 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 | - + - + - + - + | * * Side effects: * Adds encrypted data to buffer or sets result to error message * *------------------------------------------------------------------- */ int EncryptUpdate(Tcl_Interp *interp, int type, EVP_CIPHER_CTX *ctx, unsigned char *out_buf, |
︙ | |||
261 262 263 264 265 266 267 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | - + | } else { res = EVP_DecryptFinal_ex(ctx, out_buf, out_len); } if (res) { return TCL_OK; } else { |
︙ | |||
331 332 333 334 335 336 337 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | - + | Tcl_Channel parent = Tcl_GetStackedChannel(statePtr->self); int out_len; unsigned char out_buf[EVP_MAX_BLOCK_LENGTH]; /* Finalize function */ if (EncryptFinalize(interp, statePtr->type, statePtr->ctx, out_buf, &out_len) == TCL_OK) { if (out_len > 0) { |
︙ | |||
378 379 380 381 382 383 384 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | - + + - + - + - + - + - + | * Read data from transform and write to buf * *---------------------------------------------------------------------- */ int EncryptInputProc(ClientData clientData, char *buf, int toRead, int *errorCodePtr) { EncryptState *statePtr = (EncryptState *) clientData; Tcl_Channel parent; |
︙ | |||
457 458 459 460 461 462 463 | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + - + - + | char *out_buf; /* Abort if nothing to process */ if (toWrite <= 0 || statePtr->self == (Tcl_Channel) NULL) { return 0; } |
︙ | |||
816 817 818 819 820 821 822 | 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | - + | /* Validate arg count */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channelId"); return TCL_ERROR; } /* Get channel */ |
︙ | |||
856 857 858 859 860 861 862 | 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | + - + | * Side effects: * Adds data to encrypt/decrypt function * *------------------------------------------------------------------- */ int EncryptInstanceObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { EncryptState *statePtr = (EncryptState *) clientData; int fn, out_len; |
︙ | |||
897 898 899 900 901 902 903 | 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 | - + - + | Tcl_WrongNumArgs(interp, 1, objv, "update data"); Tcl_DecrRefCount(resultObj); return TCL_ERROR; } /* Update function */ if (EncryptUpdate(interp, statePtr->type, statePtr->ctx, out_buf, &out_len, data, data_len) == TCL_OK) { |
︙ | |||
960 961 962 963 964 965 966 | 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | - + | * Creates command or error message * *------------------------------------------------------------------- */ int EncryptCommandHandler(Tcl_Interp *interp, int type, Tcl_Obj *cmdObj, Tcl_Obj *cipherObj, Tcl_Obj *digestObj, Tcl_Obj *keyObj, Tcl_Obj *ivObj) { EncryptState *statePtr; |
︙ | |||
1005 1006 1007 1008 1009 1010 1011 | 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 | - + + - + | * Sets result or error message * *------------------------------------------------------------------- */ int EncryptDataHandler(Tcl_Interp *interp, int type, Tcl_Obj *dataObj, Tcl_Obj *cipherObj, Tcl_Obj *digestObj, Tcl_Obj *keyObj, Tcl_Obj *ivObj) { EVP_CIPHER_CTX *ctx = NULL; |
︙ | |||
1040 1041 1042 1043 1044 1045 1046 | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | - + | goto done; } out_len += len; done: /* Set output result */ if (res == TCL_OK) { |
︙ | |||
1101 1102 1103 1104 1105 1106 1107 | 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | - + - + | /* Initialize operation */ if ((res = EncryptInitialize(interp, type, &ctx, cipherObj, keyObj, ivObj)) != TCL_OK) { goto done; } /* Read file data from inFile, encrypt/decrypt it, then output to outFile */ while (!Tcl_Eof(in)) { |
︙ | |||
1127 1128 1129 1130 1131 1132 1133 | 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 | - + | goto done; } } /* Finalize data and write any remaining data in block */ if ((res = EncryptFinalize(interp, type, ctx, out_buf, &out_len)) == TCL_OK) { if (out_len > 0) { |
︙ | |||
1185 1186 1187 1188 1189 1190 1191 | 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 | - + + - + - + | * *------------------------------------------------------------------- */ static int EncryptMain(int type, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *cipherObj = NULL, *cmdObj = NULL, *dataObj = NULL, *digestObj = NULL; Tcl_Obj *inFileObj = NULL, *outFileObj = NULL, *keyObj = NULL, *ivObj = NULL, *macObj = NULL; const char *channel = NULL, *opt; |
︙ | |||
1270 1271 1272 1273 1274 1275 1276 | 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 | - + - + - + | macObj = objv[idx]; break; } } /* Check for required options */ if (cipherObj == NULL) { |
︙ |
Modified generic/tlsInfo.c
from [d3b28a3feb]
to [b53356134d].
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + | *------------------------------------------------------------------- */ void NamesCallback(const OBJ_NAME *obj, void *arg) { Tcl_Obj *listObj = (Tcl_Obj *) arg; /* Fields: (int) type and alias, (const char*) name (alias from) and data (alias to) */ if (strstr(obj->name, "rsa") == NULL && strstr(obj->name, "RSA") == NULL) { |
︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - + - + | *------------------------------------------------------------------- */ int CipherInfo(Tcl_Interp *interp, Tcl_Obj *nameObj) { const EVP_CIPHER *cipher; Tcl_Obj *resultObj, *listObj; unsigned long flags, mode; unsigned char *modeName = NULL; |
︙ | |||
260 261 262 263 264 265 266 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | + - + | * *------------------------------------------------------------------- */ static int CiphersObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { SSL_CTX *ctx = NULL; SSL *ssl = NULL; STACK_OF(SSL_CIPHER) *sk = NULL; Tcl_Size index; |
︙ | |||
290 291 292 293 294 295 296 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | - + - + - + - + - + - + - + - + | (objc > 2 && Tcl_GetBooleanFromObj(interp, objv[2], &verbose) != TCL_OK) || (objc > 3 && Tcl_GetBooleanFromObj(interp, objv[3], &use_supported) != TCL_OK)) { return TCL_ERROR; } switch ((enum protocol)index) { case TLS_SSL2: |
︙ | |||
394 395 396 397 398 399 400 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | - + | cp = SSL_CIPHER_get_name(c); if (cp == NULL) break; Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(cp, -1)); } } else { char buf[BUFSIZ]; |
︙ | |||
448 449 450 451 452 453 454 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | - + - + | *------------------------------------------------------------------- */ int DigestInfo(Tcl_Interp *interp, Tcl_Obj *nameObj) { EVP_MD *md; Tcl_Obj *resultObj, *listObj; unsigned long flags; int res = TCL_OK; |
︙ | |||
641 642 643 644 645 646 647 | 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | - + - + | * None. * *------------------------------------------------------------------- */ int MacInfo(Tcl_Interp *interp, Tcl_Obj *nameObj) { Tcl_Obj *resultObj; int res = TCL_OK; |
︙ | |||
746 747 748 749 750 751 752 | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | - + - + | * None. * *------------------------------------------------------------------- */ int PkeyInfo(Tcl_Interp *interp, Tcl_Obj *nameObj) { Tcl_Obj *resultObj; int res = TCL_OK; |
︙ |
Modified generic/tlsInt.h
from [e4eb0fa8cc]
to [f1514b9dc2].
︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | + + + + + + | # define CONST86 # endif #endif /* * Backwards compatibility for size type change */ #if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 #include <limits.h> #define TCL_SIZE_MAX INT_MAX #ifndef Tcl_Size typedef int Tcl_Size; #endif #define TCL_SIZE_MODIFIER "" #define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj #define Tcl_NewSizeIntObj Tcl_NewIntObj #define Tcl_NewSizeIntFromObj Tcl_NewWideIntObj #endif #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/rand.h> #include <openssl/opensslv.h> |
︙ | |||
204 205 206 207 208 209 210 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | - - - + + + | int Tls_KDFCommands(Tcl_Interp *interp); int Tls_RandCommands(Tcl_Interp *interp); BIO *BIO_new_tcl(State* statePtr, int flags); EVP_CIPHER *Util_GetCipher(Tcl_Interp *interp, Tcl_Obj *cipherObj, int no_null); EVP_MD *Util_GetDigest(Tcl_Interp *interp, Tcl_Obj *digestObj, int no_null); |
Modified generic/tlsKDF.c
from [2263ba9696]
to [81a965108c].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + | * * Side effects: * Sets result to a list of key and iv values, or an error message * *------------------------------------------------------------------- */ static int KDF_PBKDF2(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { |
︙ | |||
71 72 73 74 75 76 77 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - + | /* Get option */ if (Tcl_GetIndexFromObj(interp, objv[idx], command_opts, "option", 0, &fn) != TCL_OK) { return TCL_ERROR; } /* Validate arg has a value */ if (++idx >= objc) { |
︙ | |||
110 111 112 113 114 115 116 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - - + + - + - - + + | } break; } } /* Validate options */ if (md == NULL) { |
︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + + + | * *------------------------------------------------------------------- */ static int KDF_HKDF(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { EVP_PKEY_CTX *pctx = NULL; const EVP_MD *md = NULL; unsigned char *salt = NULL, *key = NULL, *info = NULL, *out = NULL; |
︙ | |||
193 194 195 196 197 198 199 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + | /* Get option */ if (Tcl_GetIndexFromObj(interp, objv[idx], command_opts, "option", 0, &fn) != TCL_OK) { return TCL_ERROR; } /* Validate arg has a value */ if (++idx >= objc) { |
︙ | |||
227 228 229 230 231 232 233 | 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 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | - + - + - + - + - + - - + + - - + + - - + + - + - + - + | goto error; } break; } } if (md == NULL) { |
︙ | |||
314 315 316 317 318 319 320 | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | + - + + | * Sets result to a list of key and iv values, or an error message * *------------------------------------------------------------------- */ static int KDF_Scrypt(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { EVP_PKEY_CTX *pctx = NULL; unsigned char *salt = NULL, *pass = NULL, *out = NULL; Tcl_Size salt_len = 0, pass_len = 0; |
︙ | |||
390 391 392 393 394 395 396 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | - + - - + + - - + + - + - + - + - + - + - + - + | pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, NULL); if (pctx == NULL) { Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL); goto error; } if (EVP_PKEY_derive_init(pctx) < 1) { |
︙ |
Modified generic/tlsRand.c
from [d8e5894f50]
to [8b16c00091].
︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + - + | ERR_clear_error(); /* Validate arg count */ if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?-private? length"); return TCL_ERROR; } else if (objc == 3) { |
︙ |
Modified generic/tlsUtil.c
from [8602dbd8e8]
to [b1b9224457].
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + | *------------------------------------------------------------------- */ EVP_CIPHER *Util_GetCipher(Tcl_Interp *interp, Tcl_Obj *cipherObj, int no_null) { EVP_CIPHER *cipher = NULL; char *name = NULL; if (cipherObj != NULL) { |
︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - + | *------------------------------------------------------------------- */ EVP_MD *Util_GetDigest(Tcl_Interp *interp, Tcl_Obj *digestObj, int no_null) { EVP_MD *md = NULL; char *name = NULL; if (digestObj != NULL) { |
︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - + + - + + | * Pointer to type or NULL, and size * * Side effects: * None * *------------------------------------------------------------------- */ |
︙ | |||
126 127 128 129 130 131 132 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - + | * Pointer to type or NULL, and size * * Side effects: * None * *------------------------------------------------------------------- */ |
︙ | |||
165 166 167 168 169 170 171 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - + | */ #if OPENSSL_VERSION_NUMBER >= 0x30000000L EVP_MAC *Util_GetMAC(Tcl_Interp *interp, Tcl_Obj *MacObj, int no_null) { EVP_MAC *mac = NULL; char *name = NULL; if (MacObj != NULL) { |
︙ | |||
193 194 195 196 197 198 199 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + | * Pointer to type or NULL, and size * * Side effects: * None * *------------------------------------------------------------------- */ |
︙ | |||
228 229 230 231 232 233 234 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | - + + | * Pointer to type or NULL, and size * * Side effects: * None * *------------------------------------------------------------------- */ |
︙ |
Modified tests/all.tcl
from [645653fd10]
to [7643c0fdf5].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + | if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import ::tcltest::* } # Get common functions if {[file exists [file join $path common.tcl]]} { |
︙ |
Modified tests/badssl.test
from [ef286e344c]
to [89e2c5b1af].
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - - - - + - - | # Find default CA certificates directory if {[info exists ::env(SSL_CERT_FILE)]} {set ::cafile $::env(SSL_CERT_FILE)} else {set ::cafile [file normalize {C:\Users\Brian\Documents\Source\Build\SSL-1.1\certs\cacert.pem}]} # Constraints source common.tcl # Helper functions |
︙ |
Modified tests/random.csv
from [3cadea583e]
to [354daf498a].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - - + + | # Group,Name,Constraints,Setup,Body,Cleanup,Match,Result,Output,Error Output,Return Codes command,package require tls,,,,,,,,, ,,,,,,,,,, command,# Random command,,,,,,,,, Random,Min Length,,,string length [::tls::random 0],,,0,,, Random,Example 1,,,string length [::tls::random 42],,,42,,, Random,Example 2,,,string length [::tls::random 1000],,,1000,,, Random,Private Option,,,string length [::tls::random -private 42],,,42,,, ,,,,,,,,,, command,# Random command errors,,,,,,,,, |
Modified tests/random.test
from [df2018eb63]
to [13cb064c8c].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - + - + | } -result {42} # Random command errors test Random_Errors-2.1 {Too few args} -body { ::tls::random |
︙ |