Dear gentleman,

i am beginning studying ASN as an requirement for understanding kerberV
security protocol. One of its message specification is the following:

KRB-SAFE-BODY ::= [APPLICATION 20] SEQUENCE {
        user-data[0]    OCTET STRING,
        timestamp[1]    KerberosTime OPTIONAL,
        usec[2]         INTEGER OPTIONAL,
        seq-number[3]   INTEGER OPTIONAL,
        s-address[4]    HostAddress,
        r-address[5]    HostAddress OPTIONAL
}

My doubt regards with the decoding of the input stream. For the usec and
seq-number values i have three possible scenarios:

        0) The two values are present,
        1) None of them are present,
        2) Just one of them is present.

Since both are optional and have the same type, for scenario 2, how will
i *correctly* decode an input stream? I.e. , the next value to be decode
is an integer, but will i see it as the usec or the seq-number value?

Reply via email to