mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-07 04:03:53 +00:00
Thanks to Phil Zimmermann for the code and for the license exception we needed to include it. There remains some build system integration work to be done before this code will build properly in the FreeSWITCH tree.
56 lines
746 B
C
56 lines
746 B
C
/*
|
|
* Copyright (c) 1995 Colin Plumb. All rights reserved.
|
|
* For licensing and other legal details, see the file legal.c.
|
|
*
|
|
* keys.c - allocate and free PubKey and SecKey structures.
|
|
*/
|
|
|
|
#include "first.h"
|
|
|
|
#include "bn.h"
|
|
|
|
#include "keys.h"
|
|
#include "usuals.h"
|
|
|
|
void
|
|
pubKeyBegin(struct PubKey *pub)
|
|
{
|
|
if (pub) {
|
|
bnBegin(&pub->n);
|
|
bnBegin(&pub->e);
|
|
}
|
|
}
|
|
|
|
void
|
|
pubKeyEnd(struct PubKey *pub)
|
|
{
|
|
if (pub) {
|
|
bnEnd(&pub->n);
|
|
bnEnd(&pub->e);
|
|
wipe(pub);
|
|
}
|
|
}
|
|
|
|
void
|
|
secKeyBegin(struct SecKey *sec)
|
|
{
|
|
if (sec) {
|
|
bnBegin(&sec->d);
|
|
bnBegin(&sec->p);
|
|
bnBegin(&sec->q);
|
|
bnBegin(&sec->u);
|
|
}
|
|
}
|
|
|
|
void
|
|
secKeyEnd(struct SecKey *sec)
|
|
{
|
|
if (sec) {
|
|
bnEnd(&sec->d);
|
|
bnEnd(&sec->p);
|
|
bnEnd(&sec->q);
|
|
bnEnd(&sec->u);
|
|
wipe(sec);
|
|
}
|
|
}
|