diff options
Diffstat (limited to 'src/libradius')
-rw-r--r-- | src/libradius/radius_client.h | 2 | ||||
-rw-r--r-- | src/libradius/radius_message.h | 2 | ||||
-rw-r--r-- | src/libradius/radius_socket.c | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/libradius/radius_client.h b/src/libradius/radius_client.h index cf5f79b6c..2f6c8a43a 100644 --- a/src/libradius/radius_client.h +++ b/src/libradius/radius_client.h @@ -30,7 +30,7 @@ typedef struct radius_client_t radius_client_t; * RADIUS client functionality. * * To communicate with a RADIUS server, create a client and send messages over - * it. The client allocates a socket from the best RADIUS server abailable. + * it. The client allocates a socket from the best RADIUS server available. */ struct radius_client_t { diff --git a/src/libradius/radius_message.h b/src/libradius/radius_message.h index c72773312..eb14bf08e 100644 --- a/src/libradius/radius_message.h +++ b/src/libradius/radius_message.h @@ -320,7 +320,7 @@ struct radius_message_t { radius_message_t *radius_message_create(radius_message_code_t code); /** - * Parse and verify a recevied RADIUS message. + * Parse and verify a received RADIUS message. * * @param data received message data * @return radius_message_t object, NULL if length invalid diff --git a/src/libradius/radius_socket.c b/src/libradius/radius_socket.c index 115be79fb..b3d90d3e5 100644 --- a/src/libradius/radius_socket.c +++ b/src/libradius/radius_socket.c @@ -348,7 +348,14 @@ METHOD(radius_socket_t, decrypt_msk, chunk_t, enumerator->destroy(enumerator); if (send.ptr && recv.ptr) { - return chunk_cat("mm", recv, send); + chunk_t pad = chunk_empty; + + if ((send.len + recv.len) < 64) + { /* zero-pad MSK to at least 64 bytes */ + pad = chunk_alloca(64 - send.len - recv.len); + memset(pad.ptr, 0, pad.len); + } + return chunk_cat("mmc", recv, send, pad); } chunk_clear(&send); chunk_clear(&recv); |