/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2012 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include "util/crypto/nss/nss_util.h"
#include "util/crypto/sss_crypto.h"
#include <base64.h>
/* NSS wraps b64 encoded buffers with CRLF automatically after 64 chars. This
* function strips the CRLF double-chars. The buffer can be decoded with plain
* NSS calls */
const unsigned char *inbuf,
{
int ret;
int i, j, b64size;
char *outbuf;
/* initialize NSS if needed */
ret = nspr_nss_init();
return NULL;
}
if (!b64encoded) return NULL;
return NULL;
}
for (i=0, j=0; i < b64size; i++) {
continue;
}
}
return outbuf;
}
const char *inbuf,
{
int ret;
unsigned int size;
unsigned char *outbuf;
/* initialize NSS if needed */
ret = nspr_nss_init();
return NULL;
}
if (!b64decoded) return NULL;
*outbufsize = size;
return outbuf;
}