summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2020-03-15 11:18:30 +0100
committerDaiki Ueno <dueno@redhat.com>2020-03-15 11:18:52 +0100
commit4cb07c9e3fc91e5dc28172f5d72c551e563f49dd (patch)
tree49f84f32d79289889bc79c783dffd35e52a733c9
parent9eed0aa32212e26c22e5cefdf2d3ecc4f6ac8992 (diff)
downloadgnutls-tmp-ephemeral-api.tar.gz
prf: define gnutls_prf_get as an ephemeral APItmp-ephemeral-api
Signed-off-by: Daiki Ueno <dueno@redhat.com>
-rw-r--r--lib/ephemeral_functions.gperf1
-rw-r--r--lib/gnutls_int.h2
-rw-r--r--lib/includes/gnutls/ephemeral.h2
-rw-r--r--lib/prf.c20
4 files changed, 25 insertions, 0 deletions
diff --git a/lib/ephemeral_functions.gperf b/lib/ephemeral_functions.gperf
index caf1f20e3f..1d96f18c2e 100644
--- a/lib/ephemeral_functions.gperf
+++ b/lib/ephemeral_functions.gperf
@@ -3,3 +3,4 @@
%readonly-tables
struct ephemeral_function_st { const char *name; void *func; };
%%
+gnutls_prf_get, _gnutls_prf_get
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index d9d851be62..e23e1b17f2 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -1639,4 +1639,6 @@ get_certificate_type(gnutls_session_t session,
extern unsigned int _gnutls_global_version;
+int _gnutls_prf_get(gnutls_session_t session);
+
#endif /* GNUTLS_LIB_GNUTLS_INT_H */
diff --git a/lib/includes/gnutls/ephemeral.h b/lib/includes/gnutls/ephemeral.h
index 9a9a6c8ccd..f7dfdb049d 100644
--- a/lib/includes/gnutls/ephemeral.h
+++ b/lib/includes/gnutls/ephemeral.h
@@ -53,6 +53,8 @@ static inline ret name arglist \
return ((ret (*)arglist)func)args; \
}
+GNUTLS_EPHEMERAL_INT(gnutls_prf_get, int, (gnutls_session_t session), (session))
+
/* *INDENT-OFF* */
#ifdef __cplusplus
}
diff --git a/lib/prf.c b/lib/prf.c
index 40c52d156f..ee09ed4966 100644
--- a/lib/prf.c
+++ b/lib/prf.c
@@ -348,3 +348,23 @@ gnutls_prf(gnutls_session_t session,
return ret;
}
+
+/**
+ * _gnutls_prf_get:
+ * @session: is a #gnutls_session_t type.
+ *
+ * Returns the current PRF algorithm enabled on the session.
+ *
+ * Returns: a #gnutls_mac_algorithm_t on success, or a negative error code.
+ *
+ * Since: 3.6.13
+ * Stability: Unstable
+ **/
+int
+_gnutls_prf_get(gnutls_session_t session)
+{
+ if (session->security_parameters.prf == NULL)
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+
+ return session->security_parameters.prf->id;
+}