]>
git.saurik.com Git - apple/security.git/blob - libsecurity_keychain/libDER/libDERUtils/libDERUtils.c
1 /* Copyright (c) 2005-2007 Apple Inc. All Rights Reserved. */
4 * libDERUtils.c - support routines for libDER tests & examples
6 * Created Nov. 7 2005 by dmitch
9 #include <libDERUtils/libDERUtils.h>
12 const char *DERReturnString(
15 static char unknown
[128];
18 case DR_Success
: return "DR_Success";
19 case DR_EndOfSequence
: return "DR_EndOfSequence";
20 case DR_UnexpectedTag
: return "DR_UnexpectedTag";
21 case DR_DecodeError
: return "DR_DecodeError";
22 case DR_Unimplemented
: return "DR_Unimplemented";
23 case DR_IncompleteSeq
: return "DR_IncompleteSeq";
25 sprintf(unknown
, "Unknown error (%d)", (int)drtn
);
34 fprintf(stderr
, "*** %s: %s\n", op
, DERReturnString(drtn
));