mark a bug
[openssl.git] / ssl / s3_lib.c
index 892ff753fcddd0f13d550a7b5b3c8f2ea3067569..b8ffbed64685a73a48e5fe06e75722a35b378775 100644 (file)
@@ -638,17 +638,17 @@ SSL_CIPHER *ssl3_get_cipher(unsigned int u)
                return(NULL);
        }
 
-/* The problem is that it may not be the correct record type */
 int ssl3_pending(SSL *s)
        {
-       return(s->s3->rrec.length);
+       /* The problem is that it may not be the correct record type */
+       return(s->s3->rrec.length); /* FIXME */
        }
 
 int ssl3_new(SSL *s)
        {
        SSL3_STATE *s3;
 
-       if ((s3=Malloc(sizeof *s3)) == NULL) goto err;
+       if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
        memset(s3,0,sizeof *s3);
 
        s->s3=s3;
@@ -666,11 +666,11 @@ void ssl3_free(SSL *s)
 
        ssl3_cleanup_key_block(s);
        if (s->s3->rbuf.buf != NULL)
-               Free(s->s3->rbuf.buf);
+               OPENSSL_free(s->s3->rbuf.buf);
        if (s->s3->wbuf.buf != NULL)
-               Free(s->s3->wbuf.buf);
+               OPENSSL_free(s->s3->wbuf.buf);
        if (s->s3->rrec.comp != NULL)
-               Free(s->s3->rrec.comp);
+               OPENSSL_free(s->s3->rrec.comp);
 #ifndef NO_DH
        if (s->s3->tmp.dh != NULL)
                DH_free(s->s3->tmp.dh);
@@ -678,7 +678,7 @@ void ssl3_free(SSL *s)
        if (s->s3->tmp.ca_names != NULL)
                sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
        memset(s->s3,0,sizeof *s->s3);
-       Free(s->s3);
+       OPENSSL_free(s->s3);
        s->s3=NULL;
        }
 
@@ -692,7 +692,7 @@ void ssl3_clear(SSL *s)
 
        if (s->s3->rrec.comp != NULL)
                {
-               Free(s->s3->rrec.comp);
+               OPENSSL_free(s->s3->rrec.comp);
                s->s3->rrec.comp=NULL;
                }
 #ifndef NO_DH
@@ -852,7 +852,7 @@ long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)())
                {
                if (!ssl_cert_inst(&s->cert))
                        {
-                       SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);
+                       SSLerr(SSL_F_SSL3_CALLBACK_CTRL, ERR_R_MALLOC_FAILURE);
                        return(0);
                        }
                }
@@ -1041,7 +1041,7 @@ SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
        cpp=(SSL_CIPHER **)OBJ_bsearch((char *)&cp,
                (char *)sorted,
                SSL3_NUM_CIPHERS,sizeof(SSL_CIPHER *),
-               (int (*)())ssl_cipher_ptr_id_cmp);
+               FP_ICC ssl_cipher_ptr_id_cmp);
        if ((cpp == NULL) || !(*cpp)->valid)
                return(NULL);
        else
@@ -1280,6 +1280,10 @@ int ssl3_read(SSL *s, void *buf, int len)
 
 int ssl3_peek(SSL *s, char *buf, int len)
        {
+#if 1
+       SSLerr(SSL_F_SSL3_PEEK, SSL_R_FIXME); /* function is totally broken */
+       return -1;
+#else  
        SSL3_RECORD *rr;
        int n;
 
@@ -1298,6 +1302,7 @@ int ssl3_peek(SSL *s, char *buf, int len)
                n=len;
        memcpy(buf,&(rr->data[rr->off]),(unsigned int)n);
        return(n);
+#endif
        }
 
 int ssl3_renegotiate(SSL *s)