Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310715 Details for
Bug 453651
BIO emulation is broken
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to fix the problem
nss_compat_ossl-bio-fix.patch (text/plain), 9.18 KB, created by
Bob Relyea
on 2008-07-01 20:08:37 UTC
(
hide
)
Description:
patch to fix the problem
Filename:
MIME Type:
Creator:
Bob Relyea
Created:
2008-07-01 20:08:37 UTC
Size:
9.18 KB
patch
obsolete
>diff -up ./src/nss_compat_ossl.h.bio-fix ./src/nss_compat_ossl.h >--- ./src/nss_compat_ossl.h.bio-fix 2007-09-20 10:21:53.000000000 -0700 >+++ ./src/nss_compat_ossl.h 2008-06-26 00:32:30.000000000 -0700 >@@ -207,6 +207,9 @@ struct bio_method_st > int (*destroy)(BIO *bio); > }; > >+#define BIO_C_GET_FD 207 >+#define BIO_C_GET_PEERNAME 209 >+ > BIO *BIO_new(BIO_METHOD *); > int SSL_set_bio(SSL *, BIO *, BIO *); > >diff -up ./src/ssl.c.bio-fix ./src/ssl.c >--- ./src/ssl.c.bio-fix 2008-06-26 00:32:30.000000000 -0700 >+++ ./src/ssl.c 2008-06-26 01:55:38.000000000 -0700 >@@ -23,6 +23,7 @@ > #include <secmod.h> > #include <termios.h> /* for echo on/off */ > #include <sys/stat.h> >+#include <errno.h> > > typedef struct { > PRFileDesc *pssl; >@@ -1312,6 +1313,18 @@ nspr_bio_write(PRFileDesc *fd, const voi > } > > static PRInt32 >+nspr_bio_send(PRFileDesc *fd, const void *buf, PRInt32 amount, >+ PRIntn flags, PRIntervalTime timeout) >+{ >+ BIO *bio = nspr_get_bio(fd); >+ if (!bio) { >+ return -1; >+ } >+ >+ return bio->m->bwrite(bio, buf, amount); >+} >+ >+static PRInt32 > nspr_bio_read(PRFileDesc *fd, void *buf, PRInt32 amount) > { > BIO *bio = nspr_get_bio(fd); >@@ -1323,6 +1336,267 @@ nspr_bio_read(PRFileDesc *fd, void *buf, > return bio->m->bread(bio, buf, amount); > } > >+static PRInt32 >+nspr_bio_recv(PRFileDesc *fd, void *buf, PRInt32 amount, >+ PRIntn flags, PRIntervalTime timeout) >+{ >+ BIO *bio = nspr_get_bio(fd); >+ >+ if (!bio) { >+ return -1; >+ } >+ >+ return bio->m->bread(bio, buf, amount); >+} >+ >+void >+npsr_map_error(int err) >+{ >+ PRErrorCode prError; >+ >+ switch (err ) { >+ case EACCES: >+ prError = PR_NO_ACCESS_RIGHTS_ERROR; >+ break; >+ case EADDRINUSE: >+ prError = PR_ADDRESS_IN_USE_ERROR; >+ break; >+ case EADDRNOTAVAIL: >+ prError = PR_ADDRESS_NOT_AVAILABLE_ERROR; >+ break; >+ case EAFNOSUPPORT: >+ prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; >+ break; >+ case EAGAIN: >+ prError = PR_WOULD_BLOCK_ERROR; >+ break; >+ /* >+ * On QNX and Neutrino, EALREADY is defined as EBUSY. >+ */ >+#if EALREADY != EBUSY >+ case EALREADY: >+ prError = PR_ALREADY_INITIATED_ERROR; >+ break; >+#endif >+ case EBADF: >+ prError = PR_BAD_DESCRIPTOR_ERROR; >+ break; >+#ifdef EBADMSG >+ case EBADMSG: >+ prError = PR_IO_ERROR; >+ break; >+#endif >+ case EBUSY: >+ prError = PR_FILESYSTEM_MOUNTED_ERROR; >+ break; >+ case ECONNABORTED: >+ prError = PR_CONNECT_ABORTED_ERROR; >+ break; >+ case ECONNREFUSED: >+ prError = PR_CONNECT_REFUSED_ERROR; >+ break; >+ case ECONNRESET: >+ prError = PR_CONNECT_RESET_ERROR; >+ break; >+ case EDEADLK: >+ prError = PR_DEADLOCK_ERROR; >+ break; >+#ifdef EDIRCORRUPTED >+ case EDIRCORRUPTED: >+ prError = PR_DIRECTORY_CORRUPTED_ERROR; >+ break; >+#endif >+#ifdef EDQUOT >+ case EDQUOT: >+ prError = PR_NO_DEVICE_SPACE_ERROR; >+ break; >+#endif >+ case EEXIST: >+ prError = PR_FILE_EXISTS_ERROR; >+ break; >+ case EFAULT: >+ prError = PR_ACCESS_FAULT_ERROR; >+ break; >+ case EFBIG: >+ prError = PR_FILE_TOO_BIG_ERROR; >+ break; >+ case EHOSTUNREACH: >+ prError = PR_HOST_UNREACHABLE_ERROR; >+ break; >+ case EINPROGRESS: >+ prError = PR_IN_PROGRESS_ERROR; >+ break; >+ case EINTR: >+ prError = PR_PENDING_INTERRUPT_ERROR; >+ break; >+ case EINVAL: >+ prError = PR_INVALID_ARGUMENT_ERROR; >+ break; >+ case EIO: >+ prError = PR_IO_ERROR; >+ break; >+ case EISCONN: >+ prError = PR_IS_CONNECTED_ERROR; >+ break; >+ case EISDIR: >+ prError = PR_IS_DIRECTORY_ERROR; >+ break; >+ case ELOOP: >+ prError = PR_LOOP_ERROR; >+ break; >+ case EMFILE: >+ prError = PR_PROC_DESC_TABLE_FULL_ERROR; >+ break; >+ case EMLINK: >+ prError = PR_MAX_DIRECTORY_ENTRIES_ERROR; >+ break; >+ case EMSGSIZE: >+ prError = PR_INVALID_ARGUMENT_ERROR; >+ break; >+#ifdef EMULTIHOP >+ case EMULTIHOP: >+ prError = PR_REMOTE_FILE_ERROR; >+ break; >+#endif >+ case ENAMETOOLONG: >+ prError = PR_NAME_TOO_LONG_ERROR; >+ break; >+ case ENETUNREACH: >+ prError = PR_NETWORK_UNREACHABLE_ERROR; >+ break; >+ case ENFILE: >+ prError = PR_SYS_DESC_TABLE_FULL_ERROR; >+ break; >+ /* >+ * On SCO OpenServer 5, ENOBUFS is defined as ENOSR. >+ */ >+#if defined(ENOBUFS) && (ENOBUFS != ENOSR) >+ case ENOBUFS: >+ prError = PR_INSUFFICIENT_RESOURCES_ERROR; >+ break; >+#endif >+ case ENODEV: >+ prError = PR_FILE_NOT_FOUND_ERROR; >+ break; >+ case ENOENT: >+ prError = PR_FILE_NOT_FOUND_ERROR; >+ break; >+ case ENOLCK: >+ prError = PR_FILE_IS_LOCKED_ERROR; >+ break; >+#ifdef ENOLINK >+ case ENOLINK: >+ prError = PR_REMOTE_FILE_ERROR; >+ break; >+#endif >+ case ENOMEM: >+ prError = PR_OUT_OF_MEMORY_ERROR; >+ break; >+ case ENOPROTOOPT: >+ prError = PR_INVALID_ARGUMENT_ERROR; >+ break; >+ case ENOSPC: >+ prError = PR_NO_DEVICE_SPACE_ERROR; >+ break; >+#ifdef ENOSR >+ case ENOSR: >+ prError = PR_INSUFFICIENT_RESOURCES_ERROR; >+ break; >+#endif >+ case ENOTCONN: >+ prError = PR_NOT_CONNECTED_ERROR; >+ break; >+ case ENOTDIR: >+ prError = PR_NOT_DIRECTORY_ERROR; >+ break; >+ case ENOTSOCK: >+ prError = PR_NOT_SOCKET_ERROR; >+ break; >+ case ENXIO: >+ prError = PR_FILE_NOT_FOUND_ERROR; >+ break; >+ case EOPNOTSUPP: >+ prError = PR_NOT_TCP_SOCKET_ERROR; >+ break; >+#ifdef EOVERFLOW >+ case EOVERFLOW: >+ prError = PR_BUFFER_OVERFLOW_ERROR; >+ break; >+#endif >+ case EPERM: >+ prError = PR_NO_ACCESS_RIGHTS_ERROR; >+ break; >+ case EPIPE: >+ prError = PR_CONNECT_RESET_ERROR; >+ break; >+#ifdef EPROTO >+ case EPROTO: >+ prError = PR_IO_ERROR; >+ break; >+#endif >+ case EPROTONOSUPPORT: >+ prError = PR_PROTOCOL_NOT_SUPPORTED_ERROR; >+ break; >+ case EPROTOTYPE: >+ prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; >+ break; >+ case ERANGE: >+ prError = PR_INVALID_METHOD_ERROR; >+ break; >+ case EROFS: >+ prError = PR_READ_ONLY_FILESYSTEM_ERROR; >+ break; >+ case ESPIPE: >+ prError = PR_INVALID_METHOD_ERROR; >+ break; >+ case ETIMEDOUT: >+ prError = PR_IO_TIMEOUT_ERROR; >+ break; >+#if EWOULDBLOCK != EAGAIN >+ case EWOULDBLOCK: >+ prError = PR_WOULD_BLOCK_ERROR; >+ break; >+#endif >+ case EXDEV: >+ prError = PR_NOT_SAME_DEVICE_ERROR; >+ break; >+ default: >+ prError = PR_UNKNOWN_ERROR; >+ break; >+ } >+ PR_SetError(prError, err); >+} >+ >+static PRStatus >+nspr_bio_getpeername(PRFileDesc *fd, PRNetAddr *addr) >+{ >+ BIO *bio = nspr_get_bio(fd); >+ int osfd; >+ int ret; >+ PRUint32 addrlen; >+ >+ if (!bio) { >+ return -1; >+ } >+ ret = bio->m->ctrl(bio, BIO_C_GET_PEERNAME, sizeof(PRNetAddr), addr); >+ if (ret > 0) { >+ return PR_SUCCESS; >+ } >+ >+ ret = bio->m->ctrl(bio, BIO_C_GET_FD, sizeof(osfd), &osfd); >+ if (ret <= 0) { >+ PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); >+ return PR_FAILURE; >+ } >+ ret = getpeername(osfd, (struct sockaddr *) addr, &addrlen); >+ if (ret < 0) { >+ npsr_map_error(errno); >+ } >+ >+ return ret == 0 ? PR_SUCCESS : PR_FAILURE; >+} >+ >+ > static PRStatus > nspr_bio_close(PRFileDesc *fd) > { >@@ -1357,6 +1631,9 @@ ssl_init_bio() > gBioMethods.write = nspr_bio_write; > gBioMethods.read = nspr_bio_read; > gBioMethods.close = nspr_bio_close; >+ gBioMethods.send = nspr_bio_send; >+ gBioMethods.recv = nspr_bio_recv; >+ gBioMethods.getpeername = nspr_bio_getpeername; > } > > void SSL_load_error_strings(void) >@@ -2542,11 +2819,9 @@ int SSL_set_bio(SSL *s, BIO *bio, BIO *b > } > > /* close the previous layer */ >- old = PR_PopIOLayer(s, gIdentity); >- if (!old) { >- old = PR_PopIOLayer(s, gBioIdentity); >- } >+ old = PR_GetIdentitiesLayer(s, gBioIdentity); > if (old) { >+ PR_PopIOLayer(s, gBioIdentity); > old->dtor(old); > } > >@@ -2555,7 +2830,7 @@ int SSL_set_bio(SSL *s, BIO *bio, BIO *b > if (new == NULL) > goto error; > nspr_set_bio(new , bio); >- if (PR_PushIOLayer(s, PR_TOP_IO_LAYER, new) != PR_SUCCESS) >+ if (PR_PushIOLayer(s, PR_GetLayersIdentity(s->lower), new) != PR_SUCCESS) > goto error; > > return 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 453651
: 310715 |
310716