This chapter defines the RPC security services that an RPC application
may select and describes how they are supported in the basic RPC
protocol and mapped to the underlying security services.
In addition to the encodings and semantics specified in this chapter,
the RPC run-time protocol machines specified in
The DCE Security Model offers a number of optional services above the basic RPC. It offers a variety of levels of security service quality. These are realised via a combination of authentication, data protection and authorisation mechanisms.
The specified models allow DCE users to invoke cryptographically secured mutual authentication of a client and server, and to pass certified authorisation data from client to server as part of the RPC invocation. The server can then discover the client's identity and authorisation credentials, and determine what access to authorise. RPC security services also provide protection against undetected modifications of call data, cryptographic privacy of data, and protection against replay of calls and data.
The RPC run-time system has two roles in this. First, it is the conduit for exchanging the security credentials between clients and servers. Second, it may protect its communications from various security threats.
The generic RPC security model and encodings specified in the following sections assume support for, but are not limited to, the ISO C standard Security Service. They may be applied to alternate security services as well. The model and encodings apply to both the connectionless and connection-oriented RPC protocols.
When an RPC is initiated with a request for security services, the service provider determines if a pairwise security context has already been established between the client and server principals. This security context might include a shared session key, sequence numbers, verification state, and so on. If this context has not been established yet for that client/server principal pair, or has expired, the client RPC service provider requests initiating credentials from the security services. If these credentials are successfully acquired, the client RPC service provider then incorporates them into the initial request. The credentials may be exchanged only on call boundaries.
The server processes these security data and then responds with its own security data. If this exchange is successful, both the client and the server have established and synchronised their initial security information. Depending on the level of service requested, this may provide strong cryptographically-based mutual authentication.
For the actual call PDUs, for control PDUs and for subsequent calls,
the selected protection services are provided. For example, if strong
integrity protection is required, each PDU is cryptographically
protected against undetected modification and deletion by the
transmitter and verified by the receiver. Or, if privacy protection is
specified, stub data for request and response PDUs is
encrypted and integrity protected. If a mismatch is found, an error
message is generated, which is encoded in a fault,
alter_context_response or bind_nak PDU for the
connection-oriented protocol or a reject PDU for the
connectionless protocol, as detailed in
A client that represents multiple user principals has the option of providing security services such that each principal is individually authenticated. When a security context is established, a requesting client principal is authenticated. An application may obtain the security credentials for additional client principals, and then cause additional mutual authentications to occur by requesting security services on behalf of the additional principals.
For each principal, the RPC protocols exchange the credentials in one of three ways:
The server may allow for a grace period of service after credentials expire to compensate for processing and communications delays. The client avoids sending requests it knows are likely to expire. To force a re-authentication, it fetches new credentials for use with the server from the security service and establishes the new security context according to the underlying protocol.
The RPC run-time system determines the security services used when accessing
name services on behalf of a principal.
Connection-oriented and connectionless PDUs may contain an optional authentication verifier. Authentication verifier encodings are largely dependent on the authentication protocol in use as detailed in the DCE: Security Services specification. The following sections specify those encodings that are authentication protocol-independent.
RPC implementations are not required to support all of the protection levels specified here, but supported protection levels must have at least this level of protection for all protocols.
Authentication verifiers encode protection levels as a single byte. The defined protection levels are as follows:
These values map directly to the values specified in
Authentication services are identified by a single byte. In connectionless PDUs, this is encoded in the PDU header field auth_proto. In connection-oriented PDUs, this is encoded in the authentication verifier. The currently supported values are as follows:
These values map directly to the values specified in
The cryptographic protocols and algorithms to which these identifiers map are defined by the DCE: Security Services specification.
Authorisation services are identified by a single byte. In the connection-oriented protocol, this is encoded in the authentication verifier. In the connectionless protocol, this is part of the data of the conversation manager challenge and response.
Two authorisation models are supported. These are encoded with the following values:
These values map directly to the values specified in
The authorisation service dce_c_authz_name asserts, without cryptographic protection, the principal name for level dce_c_authn_level_none and authenticates the principal name for other levels. The authorisation service dce_c_authz_dce asserts the principal name and authorisation data, without cryptographic protection, for level dce_c_authn_level_none and authenticates the principal and its authorisation data for other levels. The DCE: Security Services specification specifies the guarantees provided by these authorisation models.
To support RPC security, underlying security services called by RPC must provide:
The methods by which these services are instantiated are defined by
the DCE: Security Services specification. Algorithms not
defined by the DCE: Security Services specification may be used instead to provide these services
with loss of universal interoperability.
The following sections specify security semantics and encodings for connection-oriented RPC protocol when the PDU header field auth_length is non-zero and the field auth_type of the authentication verifier is dce_c_rpc_authn_protocol_krb5. Use of other protection services is permitted but is outside the scope of this specification and will reduce interoperability.
Whenever a client attempts to create a new association to a server, it must take the following steps:
These steps are required even if there are already other associations established and authenticated for the client/server pair. Each new association request must establish pairwise credentials between the client and server even if they have already been established for the same client/server pair on a different association.
While establishing security credentials, the client provider may transmit a bind PDU to establish the initial security context, or an alter_context PDU to alter or add new security contexts. It may receive bind_ack, bind_nak or alter_context_resp PDUs.
Whenever a server receives a new association request, it must take the following steps:
While establishing security credentials, the server provider may receive bind or alter_context PDUs, and transmit bind_ack, bind_nak or alter_context_resp PDUs.
While sequence numbers are not transmitted explicitly by the RPC protocol, they are used in the computation of various security checks for the PDUs. Sequence numbers are initialised to 0 (zero) on the establishment of each association and used by all PDUs even when no security services have been requested. Every PDU transmitted, including call fragment PDUs, is assigned the value of next_send_seq, which is then atomically incremented. Implementations must ensure that PDUs are transmitted in the same order that the sequence numbers are assigned. Receivers must check the anticipated next_recv_seq value against the received PDUs, and then atomically increment next_recv_seq. Any out-of-order PDUs generate an invalid_checksum reject status code, which is transmitted in the fault, bind_ack and alter_context_response PDUs. Implementations must take care to verify the received PDU sequence numbers in the same order the PDUs are received.
The most significant bit of the sequence number is used as a direction indicator. When requesting security services using the sequence numbers assigned to PDUs sent from the server to the client, RPC must invert the most significant bit of the sequence number before passing the value to the underlying security services. Both client and server RPC run-time systems must perform this inversion for security processing of PDUs sent from server to client.
There is no provision for overflow of sequence numbers. The maximum value is 232-1.
The auth_context_id field is an unprotected hint that is transmitted to suggest the appropriate security context for the receiver to use. It may be used to distinguish among multiple user principals sharing the same client. This is typically a table index or pointer value that must be unique at least across the scope and lifetime of an association group.
The integrity checksums required for some of the levels of service may
be computed via different algorithms. The algorithm used to protect a
specific PDU is indicated by the value of the sub_type field,
which encodes the authentication service using one of the values given in
For all variants of the checksum, the transmitting side must pass to the underlying security services:
The computed checksum and checksum length are then inserted into their respective authentication verifier fields.
The receiving side recomputes the checksum, by invoking the underlying security services and passing (as needed):
The receiver then compares the computed checksum to the value received in the verifier. If they are identical, then the PDU is accepted as authentic.
If the receiver does not support the sub_type specified by the transmitter, an error indicating invalid checksum is returned. The callee should respond with the same subtype requested by the caller.
Most of the connection-oriented RPC PDUs, as defined in
The common authentication verifier is defined as the following
structure:
The auth_pad field is required to restore 0 mod 4 alignment following the stub data, if any. It consists of 0, 1, 2 or 3 null bytes.
The auth_type field defines which authentication service is in
use. Currently supported values are specified in
The auth_level field defines the protection level.
The supported values are specified in
The auth_pad_length field indicates the number of pad bytes that are appended to the header and stub data before the authentication verifier.
The auth_reserved field is reserved for future use. It must be 0 (zero) on transmission, and it is ignored on reception.
The auth_context_id field indicates the corresponding security context previously established.
The auth_value field may contain a variety of security-related
data. For the bind, bind_ack, alter_context and
alter_context_response PDUs, this field encodes credentials.
For other PDUs, this field holds checksums and other per-PDU
security data that depend on the protection level. Encodings of this
field depend on the PDU type, authentication service, authorisation
service and protection level.
Authentication verifiers contain an auth_value field that holds checksums, credentials and other security-related data. When used for per-PDU security services, the auth_value encoding depends on the protection level. The following sections define the encodings of the auth_value field to provide per-PDU security services. For protection level dce_c_authn_level_pkt_privacy, the encryption of the PDU body data is also specified.
The encodings are modelled as IDL structure definitions. As in the RPC PDU definitions, they assume no padding between elements, and they assume NDR transfer syntax.
The sub_type fields in auth_value encodings allow variant algorithms for providing the same level of services. This field can also be used to indicate that an invalid checksum was received. The currently defined values are as follows:
The mapping from the values dce_c_cn_dce_sub_type and dce_c_cn_dce_sub_type_md5 to specific algorithms is defined by the DCE: Security Services specification. The value dce_c_cn_dce_sub_type_invalid_checksum is used to indicate that an invalid checksum was detected.
The following sections specify auth_value encodings for each protection level.
The auth_value is null; the entire authentication verifier may be omitted.
The auth_value encoding is as follows:
This level is not supported as a separate entity. Instead, requests for this level will automatically be upgraded to dce_c_authn_level_pkt.
The auth_value encoding is as follows:
where the field "checksum" is the checksum value returned by the
underlying security service in response to an integrity protection
call (see
The auth_value encoding is as follows:
where the field "checksum" is the checksum value returned by the
underlying security service in response to an integrity protection
call (see
In contrast to the other security levels, this level also requires changes to the contents of the body data of the standard RPC PDUs. This level of service provides strong integrity protection for the entire PDU, plus privacy protection for the body data only. Therefore, only the bodies of the request, response and fault PDUs are encrypted.
The auth_value encoding is as follows:
The PDU to be protected is divided into two pieces: the RPC header and the PDU body composed of data generated by the stub's marshalling procedures. The following is passed to underlying security service in a call requesting privacy protection:
The underlying security service returns the privacy protected PDU body, if any, and a checksum value.
If there was a PDU body, then the privacy protected PDU body replaces the original, unprotected PDU body in the PDU. The returned checksum value is inserted into the authentication verifier checksum field. The resulting PDU may then be transmitted.
If there was no PDU body, then the checksum value is inserted into the checksum field of the authentication verifier. The resulting PDU may then be transmitted.
The DCE: Security Services specification defines the algorithms used to create the protected PDU body and the checksum value.
This section defines the contents of the optional auth_value fields in the bind, bind_ack, alter_context and alter_context_response PDUs as used for establishing credentials. The auth_value fields are modelled as IDL structure definitions. As in the RPC PDU definitions, the definitions assume no padding between elements, and they assume NDR transfer syntax.
For any protection level requested, including dce_c_authn_level_none, a bind PDU includes optional authentication data. If a new client principal is being introduced, either a bind for a new association or an alter_context on an existing association is used. The mutual authentication response is carried by the bind_ack or alter_context_response, respectively.
When security services are in effect, the credentials field is empty (cred_length=0) for an rpc_alter_context or rpc_alter_context_response PDU that is intended only to change non-security-related context, such as presentation context, transfer syntax, and the like.
The generic encoding is as follows:
where:
The following algorithm defines the credentials field encoding for auth_type=dce_c_rpc_authn_protocol_krb5:
For a bind or alter_context PDU with authentication level dce_c_authn_level_none, authentication service of dce_c_rpc_authn_protocol_krb5.
-
-
u_int8 authz_type=dce_c_authz_name;
char name[]; /* null-terminated local principal name */
/* size auth_length-1 */
-
-
u_int8 authz_type=dce_c_authz_dce;
byte pac[];
where the contents of the pac field is determined by the underlying security services and defined in the DCE: Security Services specification.
For a bind_ack or alter_context_response PDU with authentication level dce_c_authn_level_none, authentication service of dce_c_rpc_authn_protocol_krb5, and authorisation service of either dce_c_authz_name or dce_c_authz_dce, the credentials field has one of the following forms:
-
-
u_int32 statusq /* big-endian encoded */
For a bind or alter_context PDU with any authentication
level except dce_c_authn_level_none, authentication
service of dce_c_rpc_authn_protocol_krb5, and authorisation
service of either dce_c_authz_name or dce_c_authz_dce,
then the credentials field has the form:
where the contents of the request field is determined by the underlying security services and defined in the DCE: Security Services specification.
For a bind_ack or alter_context_response PDU with any authentication level except dce_c_authn_level_none, authentication service of dce_c_rpc_authn_protocol_krb5, and authorisation service of either dce_c_authz_name or dce_c_authz_dce, then the credentials field has one of the following forms:
-
-
byte response[];
where the contents of the response field are determined by the underlying security services and defined in the DCE: Security Services specification.
-
-
byte error[];
where the contents of the error field are determined by the underlying security services and defined in the DCE: Security Services specification.
The following sections specify security semantics and encodings for connectionless RPC protocol when the PDU header field auth_proto=dce_c_rpc_authn_protocol_krb5. Use of other protection services is permitted but outside the scope of this specification.
On receiving a PDU, the connectionless protocol machine first locates the activity record that is associated with the client. This is determined through the activity ID. If no activity record is found, one is created, and if a security service is requested, the challenge/response exchange is initiated by performing the conversation manager callback for authenticated calls.
The protocol machine verifies the conversation manager callback response PDU. If the appropriate values of the this PDU match the authentication information of the activity record (refer to the DCE: Security Services specification), the security context is established; otherwise, an error PDU (reject PDU) is generated.
The server also initiates the challenge/response exchange if it cannot locate the received session key that is associated with the key sequence number.
Based on a valid security context, the server verifies the following for each received PDU:
If mismatches are detected, error PDUs (fault PDUs) are generated.
If the fragment number in the request PDU is 0 (zero), indicating that the PDU is the first PDU of a call, the current time is compared with the expiration time of the security context. If it has expired, an error PDU is generated.
Client receive processing is identical to server receive processing, except that no attempt is made to learn the key through a challenge/response exchange.
The conv_who_are_you_auth() operation of the conversation manager provides a variable-length array of bytes on each leg of the operation by using a challenge/response exchange. Should the response to the challenge require more than a full packet of data, the status code of rpc_s_partial_credentials is returned. While the status code remains rpc_s_partial_credentials, subsequent calls to conv_who_are_you_auth_more() are made.
The conversation manager challenge request PDU, which is
generated by the server, is entirely in plaintext because the server
does not necessarily share any keys with the client. It is
transferred in the in_data parameter (that is, as the stub data
of an RPC request PDU) of the conv_who_are_you_auth()
and conv_who_are_you_auth_more() operations.
When auth_proto=dce_c_rpc_authn_protocol_krb5,
it is 12 bytes long and consists of:
The response is transferred as the out_data parameter (that is, as stub data of an RPC response PDU) of the conv_who_are_you_auth() and conv_who_are_you_auth_more() conversation manager operations. The contents of this PDU are specified in the DCE: Security Services specification.
Connectionless PDUs contain an authentication verifier if the PDU header field auth_proto is non-zero. Otherwise, the authentication verifier is not present.
The encoding and length of the authentication verifier depends on the authentication service, as identified by the PDU header field auth_proto.
The authentication data encodings for the PDU authentication verifier are specified in the following sections for auth_proto=dce_c_rpc_authn_protocol_krb5.
Unless specified otherwise, the data types and values are encoded in
the NDR transfer syntax. Note that no padding between elements within
a data structure is assumed and that the alignment requirements for
the PDU header (see
When the PDU header field
auth_proto=dce_c_rpc_authn_protocol_krb5,
every PDU contains a 20 or
24-byte authentication verifier. The first three fields of the
verifier consist of a plaintext header followed by an 16-byte
ciphertext authentication value, as follows:
The following sections describe the authentication value encodings for each protection level.
There is no authentication verifier in the PDU for this protection level.
The auth_value field of the verifier is ignored for this level of service, which does not provide protection per PDU.
This level is not supported. Requests for this level will automatically be upgraded to dce_c_authn_level_pkt.
For per-PDU level,
the underlying security service computes a 8-octet checksum
of a plaintext that
is supplied to the auth_value field of the authentication verifier.
The plaintext is constructed as follows:
The DCE: Security Services specification defines the algorithms used to create the checksum value for the auth_value field.
For PDU-integrity level, the underlying security service computes a 16-octet checksum of the concatenated PDU header and body data that is supplied to the auth_value field of the authentication verifier.
The DCE: Security Services specification defines the algorithms used to create the checksum value for the auth_value field.
In contrast to the other security levels, this level also requires changes to the contents of the body data of the standard RPC PDUs. This level of service provides strong integrity protection for the entire PDU, plus privacy protection for the body data only.
The PDU to be protected is divided into two pieces: the RPC header and the PDU body composed of data generated by the stub's marshalling procedures. The following is passed to the underlying security service in a call requesting privacy protection:
The underlying security service returns the privacy protected PDU body, if any, and a 16-octet checksum value.
If there was a PDU body, then the privacy protected PDU body replaces the original, unprotected PDU body in the PDU. Insert the returned checksum value into the auth_value field. The resulting PDU may then be transmitted.
If there was no PDU body, then insert the returned checksum value into the auth_value field. The resulting PDU may then be transmitted.
The DCE: Security Services specification defines the algorithms used to create the protected PDU body and the checksum value.
Please note that the html version of this specification may contain formatting aberrations. The definitive version is available as an electronic publication on CD-ROM from The Open Group.
Contents | Next section | Index |