summaryrefslogtreecommitdiffstats
path: root/tests/test_getidfromsubstr.c
diff options
context:
space:
mode:
authorAnton <anton@picapica>2018-07-16 02:46:16 +0400
committerAnton <anton@picapica>2018-07-16 02:46:16 +0400
commit523e696918070ee04a2556c864951db4e97b842b (patch)
treec7b17afa32d737de7c02d978ef2e681c43a6bd87 /tests/test_getidfromsubstr.c
parent666cfb5a5d878453fb2675fb6aaa6ea013653aeb (diff)
downloadpica-pica-523e696918070ee04a2556c864951db4e97b842b.tar.gz
pica-pica-523e696918070ee04a2556c864951db4e97b842b.zip
remove garbage
Diffstat (limited to 'tests/test_getidfromsubstr.c')
-rwxr-xr-xtests/test_getidfromsubstr.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/test_getidfromsubstr.c b/tests/test_getidfromsubstr.c
deleted file mode 100755
index 2e33a67..0000000
--- a/tests/test_getidfromsubstr.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <limits.h>
-#include <string.h>
-
-int get_id_fromsubjstr(char* DN_str,unsigned int* id)
-{
- char* tmp1;
- char* tmp2;
-
- tmp1=strstr(DN_str,"/CN=");
-
- if (!tmp1)
- return 0;
-
- tmp2=strchr(tmp1,'#');
-
- if (!tmp2)
- return 0;
-
- *tmp2=0;
-
- tmp1+=4;
-
- if (tmp1==tmp2)
- return 0;
-
- *id=(unsigned int)strtol(tmp1,0,10);
-
- *tmp2='#';
- return 1;
-}
-
-int main()
-{
- int ret;unsigned int id;
- char dnstr[]="/O=TESTNET/OU=CA/CN=#\xD1\x82\xD0\xB5\xD1\x81\xD1\x82\xD0\xB5\xD1\x80";
-
- ret=get_id_fromsubjstr(dnstr,&id);
- printf("dnstr=%s, ret=%i, id=%u \n",dnstr,ret,id);
-
-return 0;
-}