GSM48: Add a GSM48AuthRand class to parse the auth rand.
This commit is contained in:
parent
50001c769b
commit
46b476ca14
36
GSM48.st
36
GSM48.st
|
@ -248,6 +248,42 @@ Object subclass: GSM48RejectCause [
|
|||
]
|
||||
]
|
||||
|
||||
Object subclass: GSM48AuthRand [
|
||||
| rand |
|
||||
|
||||
<category: 'osmo-meesage'>
|
||||
<comment: 'I represent the 10.5.3.1 Authentication parameter RAND'>
|
||||
|
||||
GSM48AuthRand class >> length: aByteArray [ ^ 16 ]
|
||||
GSM48AuthRand class >> initWithData: aData [
|
||||
^ self new
|
||||
rand: aData;
|
||||
yourself.
|
||||
]
|
||||
|
||||
GSM48AuthRand class >> parseFrom: aByteArray [
|
||||
^ self new
|
||||
rand: (aByteArray copyFrom: 1 to: 16);
|
||||
yourself
|
||||
]
|
||||
|
||||
rand: aData [
|
||||
aData size = 16
|
||||
ifFalse: [
|
||||
Error signal: 'Data needs to be 16 byte.'.
|
||||
].
|
||||
rand := aData
|
||||
]
|
||||
|
||||
rand [
|
||||
^ rand
|
||||
]
|
||||
|
||||
writeOnDirect: aMsg [
|
||||
aMsg putByteArray: rand.
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
IEMessage subclass: GSM48MSG [
|
||||
<category: 'osmo-message'>
|
||||
|
|
Reference in New Issue