+static int mag_get_mac_size(struct mag_config *cfg)
+{
+ apr_status_t rc;
+
+ if (!cfg->mag_skey) {
+ ap_log_perror(APLOG_MARK, APLOG_INFO, 0, cfg->pool,
+ "Session key not available, generating new one.");
+ rc = SEAL_KEY_CREATE(cfg->pool, &cfg->mag_skey, NULL);
+ if (rc != OK) {
+ ap_log_perror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, cfg->pool,
+ "Failed to create sealing key!");
+ return 0;
+ }
+ }
+
+ return get_mac_size(cfg->mag_skey);
+}
+