]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix gss_get_mic_iov() example code 917/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 17 Apr 2019 05:57:28 +0000 (01:57 -0400)
committerGreg Hudson <ghudson@mit.edu>
Fri, 19 Apr 2019 00:31:29 +0000 (20:31 -0400)
The example code for gss_get_mic_iov() using a caller-provided buffer
calls gss_wrap_iov_length() and gss_wrap_iov() instead of
gss_get_mic_iov_length() and gss_get_mic_iov() as intended.  Reported
by Frank Filz.

ticket: 8797
tags: pullup
target_version: 1.17-next

doc/appdev/gssapi.rst

index d26ac0825bb1192e4c43249691eae2b28b72dea5..f574b608b14b00fd13364cd60675bf18e8f66129 100644 (file)
@@ -619,16 +619,14 @@ gss_get_mic_iov_length and gss_get_mic_iov::
     iov[1].buffer.value = "message";
     iov[1].buffer.length = 7;
 
-    major = gss_wrap_iov_length(&minor, ctx, 1, GSS_C_QOP_DEFAULT,
-                                NULL, iov, 2);
+    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_wrap_iov(&minor, ctx, 1, GSS_C_QOP_DEFAULT, NULL,
-                         iov, 2);
+    major = gss_get_mic_iov(&minor, ctx, GSS_C_QOP_DEFAULT, iov, 2);
     if (GSS_ERROR(major))
         handle_error(major, minor);