Browse code

secsipid_proc: synced with the upstream library api

Daniel-Constantin Mierla authored on 12/04/2021 05:51:41
Showing 2 changed files
... ...
@@ -92,6 +92,19 @@ extern int SecSIPIDSignJSONHP(char* headerJSON, char* payloadJSON, char* prvkeyP
92 92
 // * return: the length of `*outPtr`
93 93
 extern int SecSIPIDGetIdentity(char* origTN, char* destTN, char* attestVal, char* origID, char* x5uVal, char* prvkeyPath, char** outPtr);
94 94
 
95
+// SecSIPIDGetIdentityPrvKey --
96
+// Generate the Identity header content using the input attributes
97
+// * origTN - calling number
98
+// * destTN - called number
99
+// * attestVal - attestation level
100
+// * origID - unique ID for tracking purposes, if empty string a UUID is generated
101
+// * x5uVal - location of public certificate
102
+// * prvkeyData - content of private key to be used to generate the signature
103
+// * outPtr - to be set to the pointer containing the output (it is a
104
+//   0-terminated string); the `*outPtr` must be freed after use
105
+// * return: the length of `*outPtr`
106
+extern int SecSIPIDGetIdentityPrvKey(char* origTN, char* destTN, char* attestVal, char* origID, char* x5uVal, char* prvkeyData, char** outPtr);
107
+
95 108
 // SecSIPIDCheck --
96 109
 // check the Identity header value
97 110
 // * identityVal - identity header value
... ...
@@ -143,6 +156,26 @@ extern int SecSIPIDSetFileCacheOptions(char* dirPath, int expireVal);
143 156
 // * return: 0 - on success; -1 - on failure
144 157
 extern int SecSIPIDGetURLContent(char* urlVal, int timeoutVal, char** outPtr, int* outLen);
145 158
 
159
+// SecSIPIDOptSetS --
160
+// set a string option for the library
161
+// * optName - name of the option
162
+// * optVal - value of the option
163
+// * return: 0 if option was set, -1 otherwise
164
+extern int SecSIPIDOptSetS(char* optName, char* optVal);
165
+
166
+// SecSIPIDOptSetN --
167
+// set a number (integer) option for the library
168
+// * optName - name of the option
169
+// * optVal - value of the option
170
+// * 0 if option was set, -1 otherwise
171
+extern int SecSIPIDOptSetN(char* optName, int optVal);
172
+
173
+// SecSIPIDOptSetV --
174
+// set an option for the library
175
+// * optNameVal - string with name=value of the option
176
+// * 0 if option was set, -1 otherwise
177
+extern int SecSIPIDOptSetV(char* optNameVal);
178
+
146 179
 #ifdef __cplusplus
147 180
 }
148 181
 #endif
... ...
@@ -44,6 +44,9 @@ int secsipid_proc_bind(secsipid_papi_t *papi)
44 44
 	papi->SecSIPIDCheckFullPubKey = SecSIPIDCheckFullPubKey;
45 45
 	papi->SecSIPIDSetFileCacheOptions = SecSIPIDSetFileCacheOptions;
46 46
 	papi->SecSIPIDGetURLContent = SecSIPIDGetURLContent;
47
+	papi->SecSIPIDOptSetS = SecSIPIDOptSetS;
48
+	papi->SecSIPIDOptSetN = SecSIPIDOptSetN;
49
+	papi->SecSIPIDOptSetV = SecSIPIDOptSetV;
47 50
 
48 51
 	return 0;
49 52
 }