MCPcopy Create free account
hub / github.com/F-Stack/f-stack / openssl_reset_session

Function openssl_reset_session

dpdk/drivers/crypto/openssl/rte_openssl_pmd.c:879–921  ·  view source on GitHub ↗

Reset private session parameters */

Source from the content-addressed store, hash-verified

877
878/** Reset private session parameters */
879void
880openssl_reset_session(struct openssl_session *sess)
881{
882 /* Free all the qp_ctx entries. */
883 for (uint16_t i = 0; i < sess->ctx_copies_len; i++) {
884 if (sess->qp_ctx[i].cipher != NULL) {
885 EVP_CIPHER_CTX_free(sess->qp_ctx[i].cipher);
886 sess->qp_ctx[i].cipher = NULL;
887 }
888
889 switch (sess->auth.mode) {
890 case OPENSSL_AUTH_AS_AUTH:
891 EVP_MD_CTX_destroy(sess->qp_ctx[i].auth);
892 sess->qp_ctx[i].auth = NULL;
893 break;
894 case OPENSSL_AUTH_AS_HMAC:
895 free_hmac_ctx(sess->qp_ctx[i].hmac);
896 sess->qp_ctx[i].hmac = NULL;
897 break;
898 case OPENSSL_AUTH_AS_CMAC:
899 free_cmac_ctx(sess->qp_ctx[i].cmac);
900 sess->qp_ctx[i].cmac = NULL;
901 break;
902 }
903 }
904
905 EVP_CIPHER_CTX_free(sess->cipher.ctx);
906
907 switch (sess->auth.mode) {
908 case OPENSSL_AUTH_AS_AUTH:
909 EVP_MD_CTX_destroy(sess->auth.auth.ctx);
910 break;
911 case OPENSSL_AUTH_AS_HMAC:
912 free_hmac_ctx(sess->auth.hmac.ctx);
913 break;
914 case OPENSSL_AUTH_AS_CMAC:
915 free_cmac_ctx(sess->auth.cmac.ctx);
916 break;
917 }
918
919 if (sess->chain_order == OPENSSL_CHAIN_CIPHER_BPI)
920 EVP_CIPHER_CTX_free(sess->cipher.bpi_ctx);
921}
922
923/** Provide session for operation */
924static void *

Callers 2

process_opFunction · 0.85

Calls 2

free_hmac_ctxFunction · 0.85
free_cmac_ctxFunction · 0.85

Tested by

no test coverage detected