correct precedence of && and || in conditional to determine when
tkt_DecodeTicket5() should be called.
optimize order of ticket property evaluation to delay call to get_key()
which will require that a lock be obtained until after we know that
all of the other checks will succeed.
(cherry picked from commit
a2530f03bacc9d9115782b49bda40fc01294a70d)
* If the alternate decoder is not present, or returns -1, then
* assume the ticket is of the default style.
*/
- if (code == -1 && (kvno == RXKAD_TKT_TYPE_KERBEROS_V5)
- || (kvno == RXKAD_TKT_TYPE_KERBEROS_V5_ENCPART_ONLY)) {
+ if (code == -1 && ((kvno == RXKAD_TKT_TYPE_KERBEROS_V5)
+ || (kvno == RXKAD_TKT_TYPE_KERBEROS_V5_ENCPART_ONLY))) {
code =
tkt_DecodeTicket5(tix, tlen, tsp->get_key, tsp->get_key_rock,
kvno, client.name, client.instance, client.cell,
v5_serv_kvno = *t5.enc_part.kvno;
}
-
- code = (*get_key) (get_key_rock, v5_serv_kvno, &serv_key);
- if (code)
- goto unknown_key;
-
/* Check that the key type really fit into 8 bytes */
switch (t5.enc_part.etype) {
case ETYPE_DES_CBC_CRC:
|| t5.enc_part.cipher.length % 8 != 0)
goto bad_ticket;
+ code = (*get_key) (get_key_rock, v5_serv_kvno, &serv_key);
+ if (code)
+ goto unknown_key;
+
/* Decrypt data here, save in plain, assume it will shrink */
code =
krb5_des_decrypt(&serv_key, t5.enc_part.etype,