-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from nasa/AKMC-113
AKMC-113: Add SADB Interfaces for MySQL/Inmemory configurability and basic implementation.
- Loading branch information
Showing
20 changed files
with
2,105 additions
and
1,468 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
36 changes: 36 additions & 0 deletions
36
fsw/crypto_sadb/sadb_mariadb_admin_scripts/create_sadb.sql
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,36 @@ | ||
CREATE DATABASE IF NOT EXISTS sadb; | ||
|
||
USE sadb; | ||
|
||
-- IV_LEN should probably not have that default -- to be reviewed. | ||
|
||
CREATE TABLE security_associations | ||
( | ||
spi INT NOT NULL | ||
,ekid MEDIUMINT NOT NULL DEFAULT spi | ||
,akid MEDIUMINT NOT NULL DEFAULT spi | ||
,sa_state SMALLINT NOT NULL DEFAULT 0 | ||
,tfvn TINYINT | ||
,scid SMALLINT | ||
,vcid TINYINT | ||
,mapid TINYINT | ||
,lpid SMALLINT | ||
,est SMALLINT | ||
,ast SMALLINT | ||
,shivf_len SMALLINT | ||
,shsnf_len SMALLINT | ||
,shplf_len SMALLINT | ||
,stmacf_len SMALLINT | ||
,ecs_len SMALLINT | ||
,ecs SMALLINT NOT NULL DEFAULT 0 | ||
,iv_len SMALLINT NOT NULL DEFAULT 12 | ||
,iv BINARY(12) NOT NULL DEFAULT 0 -- IV_SIZE=12 | ||
,acs_len SMALLINT NOT NULL DEFAULT 0 | ||
,acs SMALLINT NOT NULL DEFAULT 0 | ||
,abm_len MEDIUMINT | ||
,abm SMALLINT | ||
,arc_len SMALLINT NOT NULL DEFAULT 0 | ||
,arc BINARY(20) NOT NULL DEFAULT 0 -- ARC_LEN=20 , TBD why so large... | ||
,arcw_len SMALLINT | ||
,arcw SMALLINT | ||
); |
33 changes: 33 additions & 0 deletions
33
fsw/crypto_sadb/sadb_mariadb_admin_scripts/create_sadb_unit_test_security_associations.sql
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,33 @@ | ||
USE sadb; | ||
|
||
-- SA 1 - CLEAR MODE | ||
INSERT INTO security_associations (spi,sa_state,est,ast,arc_len,arc,arcw_len,arcw,tfvn,scid,vcid,mapid) | ||
VALUES (1,3,0,0,1,0,1,5,0,3,0,0); | ||
|
||
-- SA 2 - KEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: 128 | ||
INSERT INTO security_associations (spi,ekid,sa_state,est,ast,shivf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len) | ||
VALUES (2,128,2,1,1,12,12,0,20,0,1,5,11); | ||
|
||
-- SA 3 - KEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: 129 | ||
INSERT INTO security_associations (spi,ekid,sa_state,est,ast,shivf_len,stmacf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len) | ||
VALUES (3,129,2,1,1,12,16,12,0,20,0,1,5,11); | ||
|
||
-- SA 4 - KEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: 130 | ||
INSERT INTO security_associations (spi,ekid,sa_state,est,ast,shivf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len,tfvn,scid,vcid,mapid) | ||
VALUES (4,130,2,1,1,12,12,0,20,0,1,5,11,0,3,0,0); | ||
|
||
-- SA 5 - KEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: 131 | ||
INSERT INTO security_associations (spi,ekid,sa_state,est,ast,shivf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len) | ||
VALUES (5,131,2,1,1,12,12,0,20,0,1,5,11); | ||
|
||
-- SA 6 - UNKEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: - | ||
INSERT INTO security_associations (spi,sa_state,est,ast,shivf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len) | ||
VALUES (6,1,1,1,12,12,0,20,0,1,5,11); | ||
|
||
-- SA 7 - KEYED; ARCW:5; AES-GCM; IV:00...00; IV-len:12; MAC-len:16; Key-ID: 130 | ||
INSERT INTO security_associations (spi,ekid,sa_state,est,ast,shivf_len,iv_len,iv,abm_len,abm,arcw_len,arcw,arc_len,tfvn,scid,vcid,mapid) | ||
VALUES (7,130,2,1,1,12,12,0,20,0,1,5,11,0,3,1,0); | ||
|
||
-- SA 8 - CLEAR MODE | ||
INSERT INTO security_associations (spi,sa_state,est,ast,arc_len,arc,arcw_len,arcw,tfvn,scid,vcid,mapid) | ||
VALUES (8,3,0,0,1,0,1,5,0,3,1,0); |
4 changes: 4 additions & 0 deletions
4
fsw/crypto_sadb/sadb_mariadb_admin_scripts/create_sadb_user_grant_permissions.sql
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,4 @@ | ||
DROP USER IF EXISTS 'sadb_user'; | ||
CREATE USER IF NOT EXISTS sadb_user IDENTIFIED BY 'sadb_password'; | ||
|
||
GRANT ALL PRIVILEGES ON sadb.* TO 'sadb_user'@'%'; |
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 @@ | ||
DROP DATABASE IF EXISTS sadb; |
Oops, something went wrong.