inMsg = new byte[numBytes];
for (int i = 0; i < numBytes; i++) {
inMsgTmp.write(inStream.read());
}
} catch (IOException e) {
throw new GSSException(GSSException.FAILURE);
}
inMsg = inMsgTmp.toByteArray();
/* copy input message to gss_buffer_desc for native function */
if (inMsg != null) {
gsswrapper.setDescArray(inputMsg, inMsg);
inputMsg.setLength(inMsg.length);
}
/* set default QOP if msgProp is null */
if (msgProp != null)
desiredQOP = msgProp.getQOP();
maj_status = gsswrapper.gss_get_mic(min_status, this.internGSSCtx,
msgProp.getQOP(), inputMsg, outputMsg);
if (maj_status != gsswrapper.GSS_S_COMPLETE) {
throw new GSSExceptionImpl((int) maj_status, (int) min_status[0]);
}
/* get the byte[] from our outputMsg, copy back to OutputStream */
if (outputMsg.getLength() > 0) {
byte[] temp_msg = new byte[(int) outputMsg.getLength()];
temp_msg = gsswrapper.getDescArray(outputMsg);
try {
outStream.write(temp_msg);
} catch (IOException e) {
throw new GSSException(GSSException.FAILURE);
}
}
/* release native structures */
gsswrapper.gss_release_buffer(min_status, outputMsg);