/* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * openssl-core@openssl.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.openssl.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include #include "apps.h" #include #undef PROG #define PROG prime_main int MAIN(int, char **); int MAIN(int argc, char **argv) { int hex=0; int checks=20; BIGNUM *bn=NULL; BIO *bio_out; apps_startup(); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); --argc; ++argv; while (argc >= 1 && **argv == '-') { if(!strcmp(*argv,"-hex")) hex=1; else if(!strcmp(*argv,"-checks")) if(--argc < 1) goto bad; else checks=atoi(*++argv); else { BIO_printf(bio_err,"Unknown option '%s'\n",*argv); goto bad; } --argc; ++argv; } if (argv[0] == NULL) { BIO_printf(bio_err,"No prime specified\n"); goto bad; } if ((bio_out=BIO_new(BIO_s_file())) != NULL) { BIO_set_fp(bio_out,stdout,BIO_NOCLOSE); #ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); bio_out = BIO_push(tmpbio, bio_out); } #endif } if(hex) BN_hex2bn(&bn,argv[0]); else BN_dec2bn(&bn,argv[0]); BN_print(bio_out,bn); BIO_printf(bio_out," is %sprime\n", BN_is_prime_ex(bn,checks,NULL,NULL) ? "" : "not "); BN_free(bn); BIO_free_all(bio_out); return 0; bad: BIO_printf(bio_err,"options are\n"); BIO_printf(bio_err,"%-14s hex\n","-hex"); BIO_printf(bio_err,"%-14s number of checks\n","-checks "); return 1; } e0ad255eee7c2'>caff3b92
1
2
3
4
5
6
7
8
9

                                      
                                                             




                                                                      
  
                                                              












                                                                             
                                                                                   











                                                                             
   
                                                                                                                                                                         






























                                              
                                
                                



                                     
                                     




                                  
                                
                                



                                     
                                     




                                             




                                            
           






                                                                                    
                        
                               

                           







                                          

                




                                                                        


                                         
                                                    

           

                                                             
                                                                                                          

















































                                               
                                                                    


                                    

                






                                                

                                




                                 














                                               


                         
                                 
                               







                                               


                         
                                 






                                               


                         
                                 
                               







                                               


                         
                                 






                                               


                         
                                 






                                               


                         
                                 







                                               


                         






                                               


                         
                                 







                                               


                         
                                 






                                               


                         
                                 

              








                                                    











                                                    
                       

              







                                                    
                       

              




                                                    
                
                         
                 
                       

              








                                            
                       


                          







                                            
                       









                                            










                                            











                                                 











                                                 
                       









                                                 










                                                 











                                            











                                            
                       









                                            










                                            
                       

              













































                                                    
                                  




                                          

                                    


                         
                                   
                           

                  


                                                








                       
<?xml version="1.0" encoding="UTF-8"?>
<!--
  $Id: publication-schema.rnc 4588 2012-07-06 19:43:56Z sra $
  
  RelaxNG Schema for RPKI publication protocol.
  
  libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
  run the compact syntax through trang to get XML syntax.
  
  Copyright (C) 2009-2010  Internet Systems Consortium ("ISC")
  
  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  
  Portions copyright (C) 2007-2008  American Registry for Internet Numbers ("ARIN")
  
  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS.  IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
-->
<grammar ns="http://www.hactrn.net/uris/rpki/publication-spec/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <!-- Top level PDU -->
  <start>
    <element name="msg">
      <attribute name="version">
        <data type="positiveInteger">
          <param name="maxInclusive">1</param>
        </data>
      </attribute>
      <choice>
        <group>
          <attribute name="type">
            <value>query</value>
          </attribute>
          <zeroOrMore>
            <ref name="query_elt"/>
          </zeroOrMore>
        </group>
        <group>
          <attribute name="type">
            <value>reply</value>
          </attribute>
          <zeroOrMore>
            <ref name="reply_elt"/>
          </zeroOrMore>
        </group>
      </choice>
    </element>
  </start>
  <!-- PDUs allowed in a query -->
  <define name="query_elt">
    <choice>
      <ref name="config_query"/>
      <ref name="client_query"/>
      <ref name="certificate_query"/>
      <ref name="crl_query"/>
      <ref name="manifest_query"/>
      <ref name="roa_query"/>
      <ref name="ghostbuster_query"/>
    </choice>
  </define>
  <!-- PDUs allowed in a reply -->
  <define name="reply_elt">
    <choice>
      <ref name="config_reply"/>
      <ref name="client_reply"/>
      <ref name="certificate_reply"/>
      <ref name="crl_reply"/>
      <ref name="manifest_reply"/>
      <ref name="roa_reply"/>
      <ref name="ghostbuster_reply"/>
      <ref name="report_error_reply"/>
    </choice>
  </define>
  <!-- Tag attributes for bulk operations -->
  <define name="tag">
    <attribute name="tag">
      <data type="token">
        <param name="maxLength">1024</param>
      </data>
    </attribute>
  </define>
  <!--
    Base64 encoded DER stuff
    base64 = xsd:base64Binary { maxLength="512000" }
    
    Sadly, it turns out that CRLs can in fact get longer than this for an active CA.
    Remove length limit for now, think about whether to put it back later.
  -->
  <define name="base64">
    <data type="base64Binary"/>
  </define>
  <!-- Publication URLs -->
  <define name="uri_t">
    <data type="anyURI">
      <param name="maxLength">4096</param>
    </data>
  </define>
  <define name="uri">
    <attribute name="uri">
      <ref name="uri_t"/>
    </attribute>
  </define>
  <!--
    Handles on remote objects (replaces passing raw SQL IDs).  NB:
    Unlike the up-down protocol, handles in this protocol allow "/" as a
    hierarchy delimiter.
  -->
  <define name="object_handle">
    <data type="string">
      <param name="maxLength">255</param>
      <param name="pattern">[\-_A-Za-z0-9/]*</param>
    </data>
  </define>
  <!--
    <config/> element (use restricted to repository operator)
    config_handle attribute, create, list, and destroy commands omitted deliberately, see code for details
  -->
  <define name="config_payload">
    <optional>
      <element name="bpki_crl">
        <ref name="base64"/>
      </element>
    </optional>
  </define>
  <define name="config_query" combine="choice">
    <element name="config">
      <attribute name="action">
        <value>set</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="config_payload"/>
    </element>
  </define>
  <define name="config_reply" combine="choice">
    <element name="config">
      <attribute name="action">
        <value>set</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
    </element>
  </define>
  <define name="config_query" combine="choice">
    <element name="config">
      <attribute name="action">
        <value>get</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
    </element>
  </define>
  <define name="config_reply" combine="choice">
    <element name="config">
      <attribute name="action">
        <value>get</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="config_payload"/>
    </element>
  </define>
  <!-- <client/> element (use restricted to repository operator) -->
  <define name="client_handle">
    <attribute name="client_handle">
      <ref name="object_handle"/>
    </attribute>
  </define>
  <define name="client_bool">
    <optional>
      <attribute name="clear_replay_protection">
        <value>yes</value>
      </attribute>
    </optional>
  </define>
  <define name="client_payload">
    <optional>
      <attribute name="base_uri">
        <ref name="uri_t"/>
      </attribute>
    </optional>
    <optional>
      <element name="bpki_cert">
        <ref name="base64"/>
      </element>
    </optional>
    <optional>
      <element name="bpki_glue">
        <ref name="base64"/>
      </element>
    </optional>
  </define>
  <define name="client_query" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>create</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
      <ref name="client_bool"/>
      <ref name="client_payload"/>
    </element>
  </define>
  <define name="client_reply" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>create</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
    </element>
  </define>
  <define name="client_query" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>set</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
      <ref name="client_bool"/>
      <ref name="client_payload"/>
    </element>
  </define>
  <define name="client_reply" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>set</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
    </element>
  </define>
  <define name="client_query" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>get</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
    </element>
  </define>
  <define name="client_reply" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>get</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
      <ref name="client_payload"/>
    </element>
  </define>
  <define name="client_query" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>list</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
    </element>
  </define>
  <define name="client_reply" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>list</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
      <ref name="client_payload"/>
    </element>
  </define>
  <define name="client_query" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>destroy</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
    </element>
  </define>
  <define name="client_reply" combine="choice">
    <element name="client">
      <attribute name="action">
        <value>destroy</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="client_handle"/>
    </element>
  </define>
  <!-- <certificate/> element -->
  <define name="certificate_query" combine="choice">
    <element name="certificate">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
      <ref name="base64"/>
    </element>
  </define>
  <define name="certificate_reply" combine="choice">
    <element name="certificate">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="certificate_query" combine="choice">
    <element name="certificate">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="certificate_reply" combine="choice">
    <element name="certificate">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <!-- <crl/> element -->
  <define name="crl_query" combine="choice">
    <element name="crl">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
      <ref name="base64"/>
    </element>
  </define>
  <define name="crl_reply" combine="choice">
    <element name="crl">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="crl_query" combine="choice">
    <element name="crl">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="crl_reply" combine="choice">
    <element name="crl">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <!-- <manifest/> element -->
  <define name="manifest_query" combine="choice">
    <element name="manifest">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
      <ref name="base64"/>
    </element>
  </define>
  <define name="manifest_reply" combine="choice">
    <element name="manifest">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="manifest_query" combine="choice">
    <element name="manifest">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="manifest_reply" combine="choice">
    <element name="manifest">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <!-- <roa/> element -->
  <define name="roa_query" combine="choice">
    <element name="roa">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
      <ref name="base64"/>
    </element>
  </define>
  <define name="roa_reply" combine="choice">
    <element name="roa">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="roa_query" combine="choice">
    <element name="roa">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="roa_reply" combine="choice">
    <element name="roa">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <!-- <ghostbuster/> element -->
  <define name="ghostbuster_query" combine="choice">
    <element name="ghostbuster">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
      <ref name="base64"/>
    </element>
  </define>
  <define name="ghostbuster_reply" combine="choice">
    <element name="ghostbuster">
      <attribute name="action">
        <value>publish</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="ghostbuster_query" combine="choice">
    <element name="ghostbuster">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <define name="ghostbuster_reply" combine="choice">
    <element name="ghostbuster">
      <attribute name="action">
        <value>withdraw</value>
      </attribute>
      <optional>
        <ref name="tag"/>
      </optional>
      <ref name="uri"/>
    </element>
  </define>
  <!-- <report_error/> element -->
  <define name="error">
    <data type="token">
      <param name="maxLength">1024</param>
    </data>
  </define>
  <define name="report_error_reply">
    <element name="report_error">
      <optional>
        <ref name="tag"/>
      </optional>
      <attribute name="error_code">
        <ref name="error"/>
      </attribute>
      <optional>
        <data type="string">
          <param name="maxLength">512000</param>
        </data>
      </optional>
    </element>
  </define>
</grammar>
<!--
  Local Variables:
  indent-tabs-mode: nil
  End:
-->