Module: kamailio
Branch: master
Commit: ea628d35917036a252a3a0094a250b5df3cfe037
URL:
https://github.com/kamailio/kamailio/commit/ea628d35917036a252a3a0094a250b5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-12T07:51:41+02:00
secsipid_proc: synced with the upstream library api
---
Modified: src/modules/secsipid_proc/libsecsipid.h
Modified: src/modules/secsipid_proc/secsipid_proc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ea628d35917036a252a3a0094a250b5…
Patch:
https://github.com/kamailio/kamailio/commit/ea628d35917036a252a3a0094a250b5…
---
diff --git a/src/modules/secsipid_proc/libsecsipid.h
b/src/modules/secsipid_proc/libsecsipid.h
index f0b8d51ebc..b95393ed39 100644
--- a/src/modules/secsipid_proc/libsecsipid.h
+++ b/src/modules/secsipid_proc/libsecsipid.h
@@ -92,6 +92,19 @@ extern int SecSIPIDSignJSONHP(char* headerJSON, char* payloadJSON,
char* prvkeyP
// * return: the length of `*outPtr`
extern int SecSIPIDGetIdentity(char* origTN, char* destTN, char* attestVal, char* origID,
char* x5uVal, char* prvkeyPath, char** outPtr);
+// SecSIPIDGetIdentityPrvKey --
+// Generate the Identity header content using the input attributes
+// * origTN - calling number
+// * destTN - called number
+// * attestVal - attestation level
+// * origID - unique ID for tracking purposes, if empty string a UUID is generated
+// * x5uVal - location of public certificate
+// * prvkeyData - content of private key to be used to generate the signature
+// * outPtr - to be set to the pointer containing the output (it is a
+// 0-terminated string); the `*outPtr` must be freed after use
+// * return: the length of `*outPtr`
+extern int SecSIPIDGetIdentityPrvKey(char* origTN, char* destTN, char* attestVal, char*
origID, char* x5uVal, char* prvkeyData, char** outPtr);
+
// SecSIPIDCheck --
// check the Identity header value
// * identityVal - identity header value
@@ -143,6 +156,26 @@ extern int SecSIPIDSetFileCacheOptions(char* dirPath, int
expireVal);
// * return: 0 - on success; -1 - on failure
extern int SecSIPIDGetURLContent(char* urlVal, int timeoutVal, char** outPtr, int*
outLen);
+// SecSIPIDOptSetS --
+// set a string option for the library
+// * optName - name of the option
+// * optVal - value of the option
+// * return: 0 if option was set, -1 otherwise
+extern int SecSIPIDOptSetS(char* optName, char* optVal);
+
+// SecSIPIDOptSetN --
+// set a number (integer) option for the library
+// * optName - name of the option
+// * optVal - value of the option
+// * 0 if option was set, -1 otherwise
+extern int SecSIPIDOptSetN(char* optName, int optVal);
+
+// SecSIPIDOptSetV --
+// set an option for the library
+// * optNameVal - string with name=value of the option
+// * 0 if option was set, -1 otherwise
+extern int SecSIPIDOptSetV(char* optNameVal);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/modules/secsipid_proc/secsipid_proc_mod.c
b/src/modules/secsipid_proc/secsipid_proc_mod.c
index 9356101d3a..1054582b17 100644
--- a/src/modules/secsipid_proc/secsipid_proc_mod.c
+++ b/src/modules/secsipid_proc/secsipid_proc_mod.c
@@ -44,6 +44,9 @@ int secsipid_proc_bind(secsipid_papi_t *papi)
papi->SecSIPIDCheckFullPubKey = SecSIPIDCheckFullPubKey;
papi->SecSIPIDSetFileCacheOptions = SecSIPIDSetFileCacheOptions;
papi->SecSIPIDGetURLContent = SecSIPIDGetURLContent;
+ papi->SecSIPIDOptSetS = SecSIPIDOptSetS;
+ papi->SecSIPIDOptSetN = SecSIPIDOptSetN;
+ papi->SecSIPIDOptSetV = SecSIPIDOptSetV;
return 0;
}