-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send encodings that are invalid KDC-REQs, but pass krb5_is_as_req() and krb5_is_tgs_req(), to make sure that the KDC recovers correctly from failures in decode_krb5_as_req() and decode_krb5_tgs_req(). Also send an encoding that isn't a valid KDC-REQ. (back ported from commit dae7693) ticket: 7832 (new) version_fixed: 1.11.5 status: resolved
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/python | ||
|
||
import base64 | ||
import socket | ||
from k5test import * | ||
|
||
realm = K5Realm() | ||
|
||
# Send encodings that are invalid KDC-REQs, but pass krb5_is_as_req() | ||
# and krb5_is_tgs_req(), to make sure that the KDC recovers correctly | ||
# from failures in decode_krb5_as_req() and decode_krb5_tgs_req(). | ||
|
||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
a = (hostname, realm.portbase) | ||
|
||
|
||
# Bogus AS-REQ | ||
|
||
x1 = base64.b16decode('6AFF') | ||
s.sendto(x1, a) | ||
|
||
# Make sure kinit still works. | ||
|
||
realm.kinit(realm.user_princ, password('user')) | ||
|
||
# Bogus TGS-REQ | ||
|
||
x2 = base64.b16decode('6CFF') | ||
s.sendto(x2, a) | ||
|
||
# Make sure kinit still works. | ||
|
||
realm.kinit(realm.user_princ, password('user')) | ||
|
||
# Not a KDC-REQ, even a little bit | ||
|
||
x3 = base64.b16decode('FFFF') | ||
s.sendto(x3, a) | ||
|
||
# Make sure kinit still works. | ||
|
||
realm.kinit(realm.user_princ, password('user')) | ||
|
||
success('Bogus KDC-REQ test') |