Add missing &optional attr to KRB record fields

The KRB parser allowed for the following types/fields to be left
uninitialized, so an &optional attribute was added to reflect that:

  - KRB::Error_Msg
    - pvno
    - msg_type
    - server_time
    - service_realm
    - service_name

  - KRB::KDC_Request
    - kdc_options
    - service_realm
    - till
    - nonce
    - encryption_types

Usages have also been adapted to perform existence checks.
This commit is contained in:
Jon Siwek 2019-05-16 08:52:04 -07:00
parent 72b46268f7
commit f8d7aa2387
2 changed files with 31 additions and 18 deletions

View file

@ -4483,13 +4483,13 @@ export {
## The data from the ERROR_MSG message. See :rfc:`4120`.
type KRB::Error_Msg: record {
## Protocol version number (5 for KRB5)
pvno : count;
pvno : count &optional;
## The message type (30 for ERROR_MSG)
msg_type : count;
msg_type : count &optional;
## Current time on the client
client_time : time &optional;
## Current time on the server
server_time : time;
server_time : time &optional;
## The specific error code
error_code : count;
## Realm of the ticket
@ -4497,9 +4497,9 @@ export {
## Name on the ticket
client_name : string &optional;
## Realm of the service
service_realm : string;
service_realm : string &optional;
## Name of the service
service_name : string;
service_name : string &optional;
## Additional text to explain the error
error_text : string &optional;
## Optional pre-authentication data
@ -4533,25 +4533,25 @@ export {
## Optional pre-authentication data
pa_data : vector of KRB::Type_Value &optional;
## Options specified in the request
kdc_options : KRB::KDC_Options;
kdc_options : KRB::KDC_Options &optional;
## Name on the ticket
client_name : string &optional;
## Realm of the service
service_realm : string;
service_realm : string &optional;
## Name of the service
service_name : string &optional;
## Time the ticket is good from
from : time &optional;
## Time the ticket is good till
till : time;
till : time &optional;
## The requested renew-till time
rtime : time &optional;
## A random nonce generated by the client
nonce : count;
nonce : count &optional;
## The desired encryption algorithms, in order of preference
encryption_types : vector of count;
encryption_types : vector of count &optional;
## Any additional addresses the ticket should be valid for
host_addrs : vector of KRB::Host_Address &optional;
## Additional tickets may be included for certain transactions