int ssl_add_serverhello_renegotiate_ext(SSL *s, unsigned char *p, int *len,
					int maxlen)
    {
    if(p)
        {
        if((s->s3->previous_client_finished_len +
            s->s3->previous_server_finished_len + 1) > maxlen)
            {
            SSLerr(SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT,SSL_R_RENEGOTIATE_EXT_TOO_LONG);
            return 0;
            }
        
        /* Length byte */
        *p = s->s3->previous_client_finished_len + s->s3->previous_server_finished_len;
        p++;

        memcpy(p, s->s3->previous_client_finished,
	       s->s3->previous_client_finished_len);
        p += s->s3->previous_client_finished_len;

        memcpy(p, s->s3->previous_server_finished,
	       s->s3->previous_server_finished_len);
#ifdef OPENSSL_RI_DEBUG
    fprintf(stderr, "%s RI extension sent by server\n",
    		s->s3->previous_client_finished_len ? "Non-empty" : "Empty");
#endif
        }
    
    *len=s->s3->previous_client_finished_len
	+ s->s3->previous_server_finished_len + 1;
    
    return 1;
    }