Commit 174bee0f authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

rpc: make auth_none compliant with rfc1831

The RFC spec defines auth records as:

 struct opaque_auth {
    auth_flavor flavor;
    opaque body<400>;
 };

While in the most cases for auth_none body is empty,
this is not always the case.
parent 79c9a52b
......@@ -22,21 +22,31 @@ import java.util.logging.Logger;
public class RpcAuthTypeNone implements RpcAuth, XdrAble {
private final int _type = RpcAuthType.NONE;
private byte[] body;
private final static Logger _log = Logger.getLogger(RpcAuthTypeNone.class.getName());
public void xdrDecode(XdrDecodingStream xdr) {
int len = xdr.xdrDecodeInt();
public RpcAuthTypeNone() {
this(new byte[0]);
}
public RpcAuthTypeNone(byte[] body) {
this.body = body;
}
public int type() {
return _type;
}
@Override
public void xdrDecode(XdrDecodingStream xdr) {
body = xdr.xdrDecodeDynamicOpaque();
}
@Override
public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException {
xdr.xdrEncodeInt(_type);
xdr.xdrEncodeInt(0);
xdr.xdrEncodeDynamicOpaque(body);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment