Spdk/test/unit/lib
Shuhei Matsumoto b6ab3116fc iscsi: Load CHAP secrets from file once at boot and use them in memory
For secure iSCSI targets, dynamic reconfiguration of CHAP secrets is
must to have.

Currently CHAP secrets are loaded for every CHAP authentication
operation. The current implementation will not work correctly
when CHAP secrets in the file are changed dynamically.

If SPDK loads CHAP secrets from the file only at boot and they can be
configured by RPCs, user can change CHAP secrets safely during run time.

Even if there are any users who expect dynamic reconfiguration of
CHAP secrets based on the current implementation, if we provide
this better alternative based on RPCs, they will be able to continue to
satisfy their requirement.

This patch change the current implementation so that SPDK loads
CHAP secrets from the file once at boot and uses them in memory
hereafter.

Besides, use fixed size buffers to hold CHAP secrets.
Previously dynamically allocated buffers by strdup() had been used,
but it required many nomem checks and should be avoided.
Other iSCSI targets/initiators have used fixed size buffers and SPDK
follows others.

Set the size of buffers for both user names and secrets to 256 (the
last byte is for NULL termination). 256 is sufficiently large
compared with others.

CHANGELOG will be updated in the separate patch because new RPCs will
be added instead.

Change-Id: I499e792817c2ed01c3d970bbd3d34a6b1fccf65b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/421463
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-08-27 21:13:49 +00:00
..
bdev test: fix typos in the test directory 2018-08-27 19:39:31 +00:00
blob test: fix typos in the test directory 2018-08-27 19:39:31 +00:00
blobfs blobfs: change the return type of spdk_file_truncate 2018-07-26 01:42:17 +00:00
event test/unit: add app.c unittests 2018-08-22 20:33:53 +00:00
ioat ut/ioat: drop legacy mocks 2018-07-03 16:29:42 +00:00
iscsi iscsi: Load CHAP secrets from file once at boot and use them in memory 2018-08-27 21:13:49 +00:00
json ut/json: add a few test cases to json_parse_ut 2018-07-06 22:47:18 +00:00
jsonrpc jsonrpc: call spdk_jsonrpc_free_request only from server thread 2018-08-13 20:01:07 +00:00
log rpc.py: remove references of "debug" trace flag 2018-04-25 17:31:28 +00:00
lvol lvol: destroy_lvol_bdev implementation 2018-07-25 17:06:45 +00:00
nvme test: fix typos in the test directory 2018-08-27 19:39:31 +00:00
nvmf nvmf: Move target opts to transport opts (part 1) 2018-08-27 20:43:53 +00:00
scsi scsi: Enforce to open LUN and then alloc IO channel by using descriptor 2018-07-17 17:43:28 +00:00
sock sock: fix socket memory free 2018-08-10 15:38:38 +00:00
thread test: Move poller test to the thread unit test 2018-07-02 19:12:45 +00:00
util util/base64: add base64 lib and unit tests 2018-07-19 00:50:54 +00:00
vhost ut/vhost: remove backend-specific tests 2018-07-03 22:18:57 +00:00
json_mock.c subsystem: add per module configuration dump 2018-03-23 02:47:40 -04:00
Makefile net: split sock abstraction into lib/sock 2018-06-22 17:09:57 +00:00