mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:53:32 +03:00
gskit: remove
We remove support for building curl with gskit. - This is a niche TLS library, only running on some IBM systems - no regular curl contributors use this backend - no CI builds use or verify this backend - gskit, or the curl adaption for it, lacks many modern TLS features making it an inferior solution - build breakages in this code take weeks or more to get detected - fixing gskit code is mostly done "flying blind" This removal has been advertized in DEPRECATED in Jan 2, 2023 and it has been mentioned on the curl-library mailing list. It could be brought back, this is not a ban. Given proper effort and will, gskit support is welcome back into the curl TLS backend family. Closes #11460
This commit is contained in:
parent
08b9f246f4
commit
78d6232f1f
33 changed files with 35 additions and 1995 deletions
|
|
@ -39,22 +39,6 @@ header files are thus altered during build process to use this pragma, in
|
|||
order to force libcurl enums of being type int (the pragma disposition in use
|
||||
before inclusion is restored before resuming the including unit compilation).
|
||||
|
||||
Secure socket layer is provided by the IBM GSKit API: unlike other SSL
|
||||
implementations, GSKit is based on "certificate stores" or keyrings
|
||||
rather than individual certificate/key files. Certificate stores, as well as
|
||||
"certificate labels" are managed by external IBM-defined applications.
|
||||
There are two ways to specify an SSL context:
|
||||
- By an application identifier.
|
||||
- By a keyring file pathname and (optionally) certificate label.
|
||||
To identify an SSL context by application identifier, use option
|
||||
SETOPT_SSLCERT to specify the application identifier.
|
||||
To address an SSL context by keyring and certificate label, use CURLOPT_CAINFO
|
||||
to set-up the keyring pathname, CURLOPT_SSLCERT to define the certificate label
|
||||
(omitting it will cause the default certificate in keyring to be used) and
|
||||
CURLOPT_KEYPASSWD to give the keyring password. If SSL is used without
|
||||
defining any of these options, the default (i.e.: system) keyring is used for
|
||||
server certificate validation.
|
||||
|
||||
Non-standard EBCDIC wrapper prototypes are defined in an additional header
|
||||
file: ccsidcurl.h. These should be self-explanatory to an OS/400-aware
|
||||
designer. CCSID 0 can be used to select the current job's CCSID.
|
||||
|
|
|
|||
|
|
@ -44,11 +44,6 @@
|
|||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_GSKIT
|
||||
#include <gskssl.h>
|
||||
#include <qsoasync.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
#include <gssapi.h>
|
||||
#endif
|
||||
|
|
@ -344,371 +339,6 @@ Curl_getaddrinfo_a(const char *nodename, const char *servname,
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef USE_GSKIT
|
||||
|
||||
/* ASCII wrappers for the GSKit procedures. */
|
||||
|
||||
/*
|
||||
* EBCDIC --> ASCII string mapping table.
|
||||
* Some strings returned by GSKit are dynamically allocated and automatically
|
||||
* released when closing the handle.
|
||||
* To provide the same functionality, we use a "private" handle that
|
||||
* holds the GSKit handle and a list of string mappings. This will allow
|
||||
* avoid conversion of already converted strings and releasing them upon
|
||||
* close time.
|
||||
*/
|
||||
|
||||
struct gskstrlist {
|
||||
struct gskstrlist *next;
|
||||
const char *ebcdicstr;
|
||||
const char *asciistr;
|
||||
};
|
||||
|
||||
struct Curl_gsk_descriptor {
|
||||
gsk_handle h;
|
||||
struct gskstrlist *strlist;
|
||||
};
|
||||
|
||||
int Curl_gsk_environment_open(gsk_handle *my_env_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
int rc;
|
||||
|
||||
if(!my_env_handle)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
p = (struct Curl_gsk_descriptor *) malloc(sizeof(*p));
|
||||
if(!p)
|
||||
return GSK_INSUFFICIENT_STORAGE;
|
||||
p->strlist = (struct gskstrlist *) NULL;
|
||||
rc = gsk_environment_open(&p->h);
|
||||
if(rc != GSK_OK)
|
||||
free(p);
|
||||
else
|
||||
*my_env_handle = (gsk_handle) p;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Curl_gsk_secure_soc_open(gsk_handle my_env_handle,
|
||||
gsk_handle *my_session_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
gsk_handle h;
|
||||
int rc;
|
||||
|
||||
if(!my_env_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
if(!my_session_handle)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
h = ((struct Curl_gsk_descriptor *) my_env_handle)->h;
|
||||
p = (struct Curl_gsk_descriptor *) malloc(sizeof(*p));
|
||||
if(!p)
|
||||
return GSK_INSUFFICIENT_STORAGE;
|
||||
p->strlist = (struct gskstrlist *) NULL;
|
||||
rc = gsk_secure_soc_open(h, &p->h);
|
||||
if(rc != GSK_OK)
|
||||
free(p);
|
||||
else
|
||||
*my_session_handle = (gsk_handle) p;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void gsk_free_handle(struct Curl_gsk_descriptor *p)
|
||||
{
|
||||
struct gskstrlist *q;
|
||||
|
||||
while((q = p->strlist)) {
|
||||
p->strlist = q;
|
||||
free((void *) q->asciistr);
|
||||
free(q);
|
||||
}
|
||||
free(p);
|
||||
}
|
||||
|
||||
int Curl_gsk_environment_close(gsk_handle *my_env_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
int rc;
|
||||
|
||||
if(!my_env_handle)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
if(!*my_env_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) *my_env_handle;
|
||||
rc = gsk_environment_close(&p->h);
|
||||
if(rc == GSK_OK) {
|
||||
gsk_free_handle(p);
|
||||
*my_env_handle = (gsk_handle) NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int Curl_gsk_secure_soc_close(gsk_handle *my_session_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
int rc;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
if(!*my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) *my_session_handle;
|
||||
rc = gsk_secure_soc_close(&p->h);
|
||||
if(rc == GSK_OK) {
|
||||
gsk_free_handle(p);
|
||||
*my_session_handle = (gsk_handle) NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Curl_gsk_environment_init(gsk_handle my_env_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_env_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_env_handle;
|
||||
return gsk_environment_init(p->h);
|
||||
}
|
||||
|
||||
|
||||
int Curl_gsk_secure_soc_init(gsk_handle my_session_handle)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_session_handle;
|
||||
return gsk_secure_soc_init(p->h);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
||||
const char *buffer, int bufSize)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
char *ebcdicbuf;
|
||||
int rc;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
if(!buffer)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
if(bufSize < 0)
|
||||
return GSK_ATTRIBUTE_INVALID_LENGTH;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
if(!bufSize)
|
||||
bufSize = strlen(buffer);
|
||||
ebcdicbuf = malloc(bufSize + 1);
|
||||
if(!ebcdicbuf)
|
||||
return GSK_INSUFFICIENT_STORAGE;
|
||||
QadrtConvertA2E(ebcdicbuf, buffer, bufSize, bufSize);
|
||||
ebcdicbuf[bufSize] = '\0';
|
||||
rc = gsk_attribute_set_buffer(p->h, bufID, ebcdicbuf, bufSize);
|
||||
free(ebcdicbuf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
||||
GSK_ENUM_VALUE enumValue)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
return gsk_attribute_set_enum(p->h, enumID, enumValue);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
|
||||
GSK_NUM_ID numID, int numValue)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
return gsk_attribute_set_numeric_value(p->h, numID, numValue);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
|
||||
GSK_CALLBACK_ID callBackID,
|
||||
void *callBackAreaPtr)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
return gsk_attribute_set_callback(p->h, callBackID, callBackAreaPtr);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
cachestring(struct Curl_gsk_descriptor *p,
|
||||
const char *ebcdicbuf, int bufsize, const char **buffer)
|
||||
{
|
||||
int rc;
|
||||
char *asciibuf;
|
||||
struct gskstrlist *sp;
|
||||
|
||||
for(sp = p->strlist; sp; sp = sp->next)
|
||||
if(sp->ebcdicstr == ebcdicbuf)
|
||||
break;
|
||||
if(!sp) {
|
||||
sp = (struct gskstrlist *) malloc(sizeof(*sp));
|
||||
if(!sp)
|
||||
return GSK_INSUFFICIENT_STORAGE;
|
||||
asciibuf = malloc(bufsize + 1);
|
||||
if(!asciibuf) {
|
||||
free(sp);
|
||||
return GSK_INSUFFICIENT_STORAGE;
|
||||
}
|
||||
QadrtConvertE2A(asciibuf, ebcdicbuf, bufsize, bufsize);
|
||||
asciibuf[bufsize] = '\0';
|
||||
sp->ebcdicstr = ebcdicbuf;
|
||||
sp->asciistr = asciibuf;
|
||||
sp->next = p->strlist;
|
||||
p->strlist = sp;
|
||||
}
|
||||
*buffer = sp->asciistr;
|
||||
return GSK_OK;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
||||
const char **buffer, int *bufSize)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
int rc;
|
||||
const char *mybuf;
|
||||
int mylen;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
if(!buffer || !bufSize)
|
||||
return GSK_OS400_ERROR_INVALID_POINTER;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
rc = gsk_attribute_get_buffer(p->h, bufID, &mybuf, &mylen);
|
||||
if(rc != GSK_OK)
|
||||
return rc;
|
||||
rc = cachestring(p, mybuf, mylen, buffer);
|
||||
if(rc == GSK_OK)
|
||||
*bufSize = mylen;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
||||
GSK_ENUM_VALUE *enumValue)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
return gsk_attribute_get_enum(p->h, enumID, enumValue);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
|
||||
GSK_NUM_ID numID, int *numValue)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
return gsk_attribute_get_numeric_value(p->h, numID, numValue);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
|
||||
GSK_CERT_ID certID,
|
||||
const gsk_cert_data_elem **certDataElem,
|
||||
int *certDataElementCount)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_gsk_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_gsk_handle;
|
||||
/* No need to convert code: text results are already in ASCII. */
|
||||
return gsk_attribute_get_cert_info(p->h, certID,
|
||||
certDataElem, certDataElementCount);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_session_handle;
|
||||
return gsk_secure_soc_misc(p->h, miscID);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char *readBuffer,
|
||||
int readBufSize, int *amtRead)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_session_handle;
|
||||
return gsk_secure_soc_read(p->h, readBuffer, readBufSize, amtRead);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char *writeBuffer,
|
||||
int writeBufSize, int *amtWritten)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_session_handle;
|
||||
return gsk_secure_soc_write(p->h, writeBuffer, writeBufSize, amtWritten);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
Curl_gsk_strerror_a(int gsk_return_value)
|
||||
{
|
||||
return set_thread_string(LK_GSK_ERROR, gsk_strerror(gsk_return_value));
|
||||
}
|
||||
|
||||
int
|
||||
Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle,
|
||||
int IOCompletionPort,
|
||||
Qso_OverlappedIO_t *communicationsArea)
|
||||
{
|
||||
struct Curl_gsk_descriptor *p;
|
||||
|
||||
if(!my_session_handle)
|
||||
return GSK_INVALID_HANDLE;
|
||||
p = (struct Curl_gsk_descriptor *) my_session_handle;
|
||||
return gsk_secure_soc_startInit(p->h, IOCompletionPort, communicationsArea);
|
||||
}
|
||||
|
||||
#endif /* USE_GSKIT */
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
|
||||
/* ASCII wrappers for the GSSAPI procedures. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue