[krbdev.mit.edu #8797] Issue with MIT Kerberos Documentation - Developing with GSSAPI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[krbdev.mit.edu #8797] Issue with MIT Kerberos Documentation - Developing with GSSAPI

Greg Hudson via RT-2
Whoops.  It's not a repeat of the gss_wrap_iov_length() function, but
it does call the wrong functions.  I believe it should read:

    OM_uint32 major, minor;                                                    
    gss_iov_buffer_desc iov[2];                                                
    char data[1024];                                                            
                                                                               
    iov[0].type = GSS_IOV_BUFFER_TYPE_MIC_TOKEN;                                
    iov[1].type = GSS_IOV_BUFFER_TYPE_DATA;                                    
    iov[1].buffer.value = "message";                                            
    iov[1].buffer.length = 7;                                                  
                                                                               
    major = gss_get_mic_iov_length(&minor, ctx, GSS_C_QOP_DEFAULT,
iov, 2);    
    if (GSS_ERROR(major))                                                      
        handle_error(major, minor);                                            
    if (iov[0].buffer.length > sizeof(data))                                    
        handle_out_of_space_error();                                            
    iov[0].buffer.value = data;                                                
                                                                               
    major = gss_get_mic_iov(&minor, ctx, GSS_C_QOP_DEFAULT, iov, 2);            
    if (GSS_ERROR(major))                                                      
        handle_error(major, minor);                                            

I will fix it.  If you'd like to see a working example of
gss_get_mic_iov_length() to help debug the problem you're running
into, src/tests/gssapi/t_iov.c contains code which is compiled and
run as part of "make check".
_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

RE: [krbdev.mit.edu #8797] Issue with MIT Kerberos Documentation - Developing with GSSAPI

Greg Hudson via RT-2
> Whoops.  It's not a repeat of the gss_wrap_iov_length() function, but it
does call

> the wrong functions.  I believe it should read:
>
>     OM_uint32 major, minor;
>     gss_iov_buffer_desc iov[2];
>     char data[1024];
>
>     iov[0].type = GSS_IOV_BUFFER_TYPE_MIC_TOKEN;
>     iov[1].type = GSS_IOV_BUFFER_TYPE_DATA;
>     iov[1].buffer.value = "message";
>     iov[1].buffer.length = 7;
>
>     major = gss_get_mic_iov_length(&minor, ctx, GSS_C_QOP_DEFAULT,
> iov, 2);
>     if (GSS_ERROR(major))
>         handle_error(major, minor);
>     if (iov[0].buffer.length > sizeof(data))
>         handle_out_of_space_error();
>     iov[0].buffer.value = data;
>
>     major = gss_get_mic_iov(&minor, ctx, GSS_C_QOP_DEFAULT, iov, 2);
>     if (GSS_ERROR(major))
>         handle_error(major, minor);
>
> I will fix it.  If you'd like to see a working example of
> gss_get_mic_iov_length() to help debug the problem you're running into,
> src/tests/gssapi/t_iov.c contains code which is compiled and run as part
of
> "make check".

I thought (and t_iov.c seems to confirm) that the
GSS_IOV_BUFFER_TYPE_MIC_TOKEN comes after the GSS_IOV_BUFFER_TYPE_DATA
buffer.

Thanks

Frank



_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs