Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision a90ad6ce8f4cd876b5a8897b66ef49fb50b378cd authored by Dmitry Belyavskiy on 22 May 2020, 16:00:03 UTC, committed by Dmitry Belyavskiy on 22 May 2020, 16:00:03 UTC
Missing copyright plates
Fixes #257
1 parent 1a1047a
  • Files
  • Changes
  • 6cf1688
  • /
  • gost_ctl.c
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:a90ad6ce8f4cd876b5a8897b66ef49fb50b378cd into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:a90ad6ce8f4cd876b5a8897b66ef49fb50b378cd as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:a90ad6ce8f4cd876b5a8897b66ef49fb50b378cd
content badge Iframe embedding
swh:1:cnt:64b76ad66e802a5896547f53465f679622a93cf3
gost_ctl.c
/**********************************************************************
 *                        gost_ctl.c                                  *
 *             Copyright (c) 2005-2006 Cryptocom LTD                  *
 *       This file is distributed under the same license as OpenSSL   *
 *                                                                    *
 *        Implementation of control commands for GOST engine          *
 *            OpenSSL 0.9.9 libraries required                        *
 **********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/engine.h>
#include <openssl/buffer.h>
#include "gost_lcl.h"

static char *gost_params[GOST_PARAM_MAX + 1] = { NULL };
static const char *gost_envnames[] =
    { "CRYPT_PARAMS", "GOST_PBE_HMAC", "GOST_PK_FORMAT" };

const ENGINE_CMD_DEFN gost_cmds[] = {
    {GOST_CTRL_CRYPT_PARAMS,
     "CRYPT_PARAMS",
     "OID of default GOST 28147-89 parameters",
     ENGINE_CMD_FLAG_STRING},
    {GOST_CTRL_PBE_PARAMS,
     "PBE_PARAMS",
     "Shortname of default digest alg for PBE",
     ENGINE_CMD_FLAG_STRING},
    {GOST_CTRL_PK_FORMAT,
     "GOST_PK_FORMAT",
     "Private key format params",
     ENGINE_CMD_FLAG_STRING},
    {0, NULL, NULL, 0}
};

void gost_param_free()
{
    int i;

    for (i = 0; i <= GOST_PARAM_MAX; i++) {
        OPENSSL_free(gost_params[i]);
        gost_params[i] = NULL;
    }

}

int gost_control_func(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
{
    int param = cmd - ENGINE_CMD_BASE;
    int ret = 0;
    if (param < 0 || param > GOST_PARAM_MAX) {
        return -1;
    }
    ret = gost_set_default_param(param, p);
    return ret;
}

const char *get_gost_engine_param(int param)
{
    char *tmp;
    if (param < 0 || param >= GOST_PARAM_MAX)
        return NULL;
    if (gost_params[param] != NULL) {
        return gost_params[param];
    }
    tmp = getenv(gost_envnames[param]);
    if (tmp) {
        OPENSSL_free(gost_params[param]);
        gost_params[param] = BUF_strdup(tmp);
        return gost_params[param];
    }
    return NULL;
}

int gost_set_default_param(int param, const char *value)
{
    const char *tmp;
    if (param < 0 || param >= GOST_PARAM_MAX)
        return 0;
    tmp = getenv(gost_envnames[param]);

    /*
     * if there is value in the environment, use it, else -passed string *
     */
    if (!tmp) {
        tmp = value;
    }
    OPENSSL_free(gost_params[param]);
    gost_params[param] = BUF_strdup(tmp);

    return 1;
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top