Check-in [f3a497fc67]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:Corrected wrong use of "key"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mjanssen-asn1-certs
Files: files | file ages | folders
SHA3-256: f3a497fc67489bef57bd1af1941ce587211d57b8cc25c56758a375589b434c57
User & Date: rkeene on 2020-05-04 14:57:52
Other Links: branch diff | manifest | tags
Context
2020-05-04
15:02
Updated to support cert/certfile independantly of key/keyfile check-in: 952ef184e6 user: rkeene tags: mjanssen-asn1-certs
14:57
Corrected wrong use of "key" check-in: f3a497fc67 user: rkeene tags: mjanssen-asn1-certs
14:54
Add documentation for -key and -cert check-in: 60e0733e5a user: rkeene tags: mjanssen-asn1-certs
Changes

Modified tls.c from [cb66151e80] to [f5c55ed5c6].

  1276   1276   			     "unable to set certificate file ", certfile, ": ",
  1277   1277   			     REASON(), (char *) NULL);
  1278   1278   	    SSL_CTX_free(ctx);
  1279   1279   	    return (SSL_CTX *)0;
  1280   1280   	}
  1281   1281   
  1282   1282   	/* get the private key associated with this certificate */
  1283         -	if (key == NULL) keyfile=certfile;
         1283  +	if (keyfile == NULL) {
         1284  +	    keyfile = certfile;
         1285  +	}
  1284   1286   
  1285   1287   	if (SSL_CTX_use_PrivateKey_file(ctx, F2N( keyfile, &ds),
  1286   1288   					SSL_FILETYPE_PEM) <= 0) {
  1287   1289   	    Tcl_DStringFree(&ds);
  1288   1290   	    /* flush the passphrase which might be left in the result */
  1289   1291   	    Tcl_SetResult(interp, NULL, TCL_STATIC);
  1290   1292   	    Tcl_AppendResult(interp,
................................................................................
  1309   1311   	    Tcl_AppendResult(interp,
  1310   1312   			     "unable to set certificate: ",
  1311   1313   			     REASON(), (char *) NULL);
  1312   1314   	    SSL_CTX_free(ctx);
  1313   1315   	    return (SSL_CTX *)0;
  1314   1316   	}
  1315   1317   	if (key == NULL) {
  1316         -    key=cert;
  1317         -    key_len = cert_len;
  1318         -  }
         1318  +	    key = cert;
         1319  +	    key_len = cert_len;
         1320  +	}
  1319   1321   	if (SSL_CTX_use_PrivateKey_ASN1(EVP_PKEY_RSA, ctx, key,key_len) <= 0) {
  1320   1322   	    Tcl_DStringFree(&ds);
  1321   1323   	    /* flush the passphrase which might be left in the result */
  1322   1324   	    Tcl_SetResult(interp, NULL, TCL_STATIC);
  1323   1325   	    Tcl_AppendResult(interp,
  1324   1326   			     "unable to set public key: ",
  1325   1327   			     REASON(), (char *) NULL);