Overview
Comment: | Use LAPPEND_STR() and friends |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | nijtmans |
Files: | files | file ages | folders |
SHA3-256: |
6e95e7672daa167b935f0498e5198d46 |
User & Date: | jan.nijtmans on 2024-02-23 22:57:27 |
Other Links: | branch diff | manifest | tags |
Context
2024-02-24
| ||
16:59 | No need for LAPPEND_LONG, use LAPPEND_INT check-in: 4f6f9b9874 user: jan.nijtmans tags: nijtmans | |
00:02 | Merge-mark check-in: 367b275044 user: jan.nijtmans tags: bohagan | |
2024-02-23
| ||
22:57 | Use LAPPEND_STR() and friends check-in: 6e95e7672d user: jan.nijtmans tags: nijtmans | |
21:27 | REASON() -> GET_ERR_REASON(). Add some more utilities to tlsInt.h (not used yet) check-in: 42f5f29486 user: jan.nijtmans tags: nijtmans | |
Changes
Modified generic/tls.c
from [cf8594fd4b]
to [6f7de4fd54].
︙ | ︙ | |||
1410 1411 1412 1413 1414 1415 1416 | X509_free(peer); peer = NULL; } } else { objPtr = Tcl_NewListObj(0, NULL); } | < < < | | < < < < < < | | 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 | X509_free(peer); peer = NULL; } } else { objPtr = Tcl_NewListObj(0, NULL); } LAPPEND_INT(interp, objPtr, "sbits", SSL_get_cipher_bits(statePtr->ssl, NULL)); ciphers = (char*)SSL_get_cipher(statePtr->ssl); if (ciphers != NULL && strcmp(ciphers, "(NONE)")!=0) { LAPPEND_STR(interp, objPtr, "cipher", ciphers, -1); } LAPPEND_STR(interp, objPtr, "version", SSL_get_version(statePtr->ssl), -1); Tcl_SetObjResult(interp, objPtr); return TCL_OK; } /* *------------------------------------------------------------------- |
︙ | ︙ | |||
1536 1537 1538 1539 1540 1541 1542 | return TCL_ERROR; } for (i=0; i<listc; i+=2) { str=Tcl_GetString(listv[i]); if (strcmp(str,"days")==0) { if (Tcl_GetIntFromObj(interp,listv[i+1],&days)!=TCL_OK) return TCL_ERROR; | < < < | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 | return TCL_ERROR; } for (i=0; i<listc; i+=2) { str=Tcl_GetString(listv[i]); if (strcmp(str,"days")==0) { if (Tcl_GetIntFromObj(interp,listv[i+1],&days)!=TCL_OK) return TCL_ERROR; } else if (strcmp(str,"serial")==0) { if (Tcl_GetIntFromObj(interp,listv[i+1],&serial)!=TCL_OK) return TCL_ERROR; } else if (strcmp(str,"C")==0) { k_C=Tcl_GetString(listv[i+1]); } else if (strcmp(str,"ST")==0) { k_ST=Tcl_GetString(listv[i+1]); |
︙ | ︙ | |||
1723 1724 1725 1726 1727 1728 1729 | * * This is a package initialization procedure, which is called * by Tcl when this package is to be added to an interpreter. * * Results: Ssl configured and loaded * * Side effects: | | | 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 | * * This is a package initialization procedure, which is called * by Tcl when this package is to be added to an interpreter. * * Results: Ssl configured and loaded * * Side effects: * create the ssl command, initialize ssl context * *------------------------------------------------------------------- */ #ifndef STRINGIFY # define STRINGIFY(x) STRINGIFY1(x) # define STRINGIFY1(x) #x |
︙ | ︙ |
Modified generic/tlsX509.c
from [6adf085ff1]
to [54cb39143a].
1 2 3 4 5 6 7 8 9 10 11 12 | /* * Copyright (C) 1997-2000 Sensus Consulting Ltd. * Matt Newman <[email protected]> */ #include "tlsInt.h" /* * Ensure these are not macros - known to be defined on Win32 */ #ifdef min #undef min #endif | > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /* * Copyright (C) 1997-2000 Sensus Consulting Ltd. * Matt Newman <[email protected]> * Copyright (C) 2023 Brian O'Hagan */ #include "tlsInt.h" /* Define maximum certificate size. Max PEM size 100kB and DER size is 24kB. */ #define CERT_STR_SIZE 32768 /* * Ensure these are not macros - known to be defined on Win32 */ #ifdef min #undef min #endif |
︙ | ︙ | |||
80 81 82 83 84 85 86 | * Result: * A Tcl List Object representing the provided * X509 certificate. * *------------------------------------------------------* */ | < < | | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | * Result: * A Tcl List Object representing the provided * X509 certificate. * *------------------------------------------------------* */ Tcl_Obj* Tls_NewX509Obj( Tcl_Interp *interp, X509 *cert) { Tcl_Obj *certPtr = Tcl_NewListObj( 0, NULL); BIO *bio; int n; unsigned long flags; char subject[BUFSIZ]; char issuer[BUFSIZ]; |
︙ | ︙ | |||
167 168 169 170 171 172 173 | #ifndef NO_SSL_SHA X509_digest(cert, EVP_sha1(), sha_hash_binary, NULL); for (shai = 0; shai < SHA_DIGEST_LENGTH; shai++) { sha_hash_ascii[shai * 2] = shachars[(sha_hash_binary[shai] & 0xF0) >> 4]; sha_hash_ascii[shai * 2 + 1] = shachars[(sha_hash_binary[shai] & 0x0F)]; } | < | | < < < | < < < | < < < | < < < | < < < | < < < | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | #ifndef NO_SSL_SHA X509_digest(cert, EVP_sha1(), sha_hash_binary, NULL); for (shai = 0; shai < SHA_DIGEST_LENGTH; shai++) { sha_hash_ascii[shai * 2] = shachars[(sha_hash_binary[shai] & 0xF0) >> 4]; sha_hash_ascii[shai * 2 + 1] = shachars[(sha_hash_binary[shai] & 0x0F)]; } LAPPEND_STR(interp, certPtr, "sha1_hash", sha_hash_ascii, SHA_DIGEST_LENGTH * 2); #endif LAPPEND_STR(interp, certPtr, "subject", subject, -1); LAPPEND_STR(interp, certPtr, "issuer", issuer, -1); LAPPEND_STR(interp, certPtr, "notBefore", notBefore, -1); LAPPEND_STR(interp, certPtr, "notAfter", notAfter, -1); LAPPEND_STR(interp, certPtr, "serial", serial, -1); LAPPEND_STR(interp, certPtr, "certificate", certStr, -1); return certPtr; } |