Purge warnings from prism2 drivers
[gpxe.git] / src / crypto / framework.c
blob0da2cbe32ec8f910e9645040899f3fa73c33f031
1 /* mcb - this file breaks the build process; temporarily deactivating */
2 #if 0
4 #include <stdlib.h>
5 #include <sys/types.h>
6 #include <sys/socket.h>
7 #include <netinet/in.h>
8 #include <netdb.h>
9 #include "ssl.h"
11 int main(int argc, char *argv[])
13 SSL_t ssl;
14 int sockfd, portno, rc;
15 struct sockaddr_in serv_addr;
16 struct hostent *server;
18 portno = 443;
19 sockfd = socket(AF_INET,SOCK_STREAM,0);
20 if(sockfd<0){
21 fprintf(stderr,"Error creating socket\n");
22 exit(sockfd);
25 server = gethostbyname(argv[1]);
26 if(server==NULL){
27 fprintf(stderr,"Error looking up host %s\n",argv[1]);
28 exit(1);
31 /**
32 *matrixSslOpen()
33 *matrixSslReadKeys()
34 **/
35 printf("Calling CreateSSLHello()\n");
36 rc = CreateSSLHello(&ssl);
37 printf("Finished calling CreateSSLHello()\n");
39 bzero((char *) &serv_addr, sizeof(serv_addr));
40 serv_addr.sin_family = AF_INET;
41 bcopy((char *)server->h_addr,(char *)&serv_addr.sin_addr.s_addr,server->h_length);
42 serv_addr.sin_port = htons(portno);
43 if(connect(sockfd,(struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0){
44 fprintf(stderr,"ERROR connecting to server\n");
45 exit(1);
48 PrintSSLPacket(&ssl);
50 printf("Write ssl.buffer\n");
51 write(sockfd,ssl.buffer,ssl.length);
52 printf("Finished writing\n");
53 ssl.length = read(sockfd,ssl.buffer,ssl.max_size);
54 ReadSSLHello(&ssl);
56 /**
57 *matrixSslNewSession()
58 *matrixSslSetCetValidator()
59 *encodeSslHandshake()
61 *write handshake buffer
63 *readSslResponse() <-+
65 *read return code |-- similar/same function??
67 *sslEncode() |
68 *sslDecode() <-------+
70 *encodeSslCloseAlert()
72 *write close alert buffer
73 **/
74 close(sockfd);
76 /**
77 *sslClose()
78 * -free connection
79 * -free keys
80 * -close pki interface
81 **/
83 return 0;
86 #endif